More changes: sort in messagelist, "All Accounts" in treeWidget, some actions
This commit is contained in:
parent
8e99226fee
commit
3a589e5344
|
@ -731,16 +731,6 @@ class MainWindow(Window):
|
||||||
tableWidget.horizontalHeaderItem(3).setText(_translate("MainWindow", "Sent", None))
|
tableWidget.horizontalHeaderItem(3).setText(_translate("MainWindow", "Sent", None))
|
||||||
tableWidget.setUpdatesEnabled(True)
|
tableWidget.setUpdatesEnabled(True)
|
||||||
|
|
||||||
def switchMessagelist(
|
|
||||||
self, view, account,
|
|
||||||
folder='inbox', search_option=None, search_line=None
|
|
||||||
):
|
|
||||||
model = view.model()
|
|
||||||
update = {'folder': folder}
|
|
||||||
if account:
|
|
||||||
update['toaddress'] = account
|
|
||||||
model.updateFilter(update)
|
|
||||||
|
|
||||||
# Load messages from database file
|
# Load messages from database file
|
||||||
def loadMessagelist(self, tableWidget, account, folder="inbox", where="", what="", unreadOnly = False):
|
def loadMessagelist(self, tableWidget, account, folder="inbox", where="", what="", unreadOnly = False):
|
||||||
if folder == 'sent':
|
if folder == 'sent':
|
||||||
|
@ -2867,7 +2857,7 @@ class MainWindow(Window):
|
||||||
self.treeWidgetChans
|
self.treeWidgetChans
|
||||||
]
|
]
|
||||||
if currentIndex >= 2 and currentIndex - 2 < len(treeWidgetList):
|
if currentIndex >= 2 and currentIndex - 2 < len(treeWidgetList):
|
||||||
return treeWidgetList[currentIndex]
|
return treeWidgetList[currentIndex - 2]
|
||||||
|
|
||||||
def getAccountTreeWidget(self, account):
|
def getAccountTreeWidget(self, account):
|
||||||
if account.type == AccountMixin.CHAN:
|
if account.type == AccountMixin.CHAN:
|
||||||
|
@ -2913,7 +2903,7 @@ class MainWindow(Window):
|
||||||
self.textEditInboxMessageChans,
|
self.textEditInboxMessageChans,
|
||||||
]
|
]
|
||||||
if currentIndex >= 2 and currentIndex - 2 < len(messagelistList):
|
if currentIndex >= 2 and currentIndex - 2 < len(messagelistList):
|
||||||
return messagelistList[currentIndex]
|
return messagelistList[currentIndex - 2]
|
||||||
|
|
||||||
def getAccountTextedit(self, account):
|
def getAccountTextedit(self, account):
|
||||||
try:
|
try:
|
||||||
|
@ -2935,9 +2925,9 @@ class MainWindow(Window):
|
||||||
]
|
]
|
||||||
if currentIndex >= 2 and currentIndex - 2 < len(messagelistList):
|
if currentIndex >= 2 and currentIndex - 2 < len(messagelistList):
|
||||||
if retObj:
|
if retObj:
|
||||||
return messagelistList[currentIndex]
|
return messagelistList[currentIndex - 2]
|
||||||
else:
|
else:
|
||||||
return messagelistList[currentIndex].text().toUtf8().data()
|
return messagelistList[currentIndex - 2].text().toUtf8().data()
|
||||||
|
|
||||||
def getCurrentSearchOption(self, currentIndex=None):
|
def getCurrentSearchOption(self, currentIndex=None):
|
||||||
if currentIndex is None:
|
if currentIndex is None:
|
||||||
|
@ -2947,7 +2937,7 @@ class MainWindow(Window):
|
||||||
self.inboxSearchOptionChans,
|
self.inboxSearchOptionChans,
|
||||||
]
|
]
|
||||||
if currentIndex >= 2 and currentIndex - 2 < len(messagelistList):
|
if currentIndex >= 2 and currentIndex - 2 < len(messagelistList):
|
||||||
return messagelistList[currentIndex].currentText().toUtf8().data()
|
return messagelistList[currentIndex - 2].currentText().toUtf8().data()
|
||||||
|
|
||||||
# Group of functions for the Your Identities dialog box
|
# Group of functions for the Your Identities dialog box
|
||||||
def getCurrentItem(self, treeWidget=None):
|
def getCurrentItem(self, treeWidget=None):
|
||||||
|
@ -3348,15 +3338,13 @@ class MainWindow(Window):
|
||||||
messageTextedit = self.getCurrentMessageTextedit()
|
messageTextedit = self.getCurrentMessageTextedit()
|
||||||
if messageTextedit:
|
if messageTextedit:
|
||||||
messageTextedit.setPlainText(QtCore.QString(""))
|
messageTextedit.setPlainText(QtCore.QString(""))
|
||||||
messagelist = self.getCurrentMessagelist() or self.messagelistInbox
|
messagelist = self.getCurrentMessagelist()
|
||||||
|
if not messagelist:
|
||||||
|
return
|
||||||
# ??
|
# ??
|
||||||
account = self.getCurrentAccount()
|
account = self.getCurrentAccount()
|
||||||
folder = self.getCurrentFolder()
|
folder = self.getCurrentFolder()
|
||||||
treeWidget = self.getCurrentTreeWidget()
|
treeWidget = self.getCurrentTreeWidget()
|
||||||
if isinstance(messagelist, QtGui.QTableView):
|
|
||||||
self.switchMessagelist(
|
|
||||||
messagelist, account, folder, searchOption, searchLine)
|
|
||||||
return
|
|
||||||
# refresh count indicator
|
# refresh count indicator
|
||||||
self.propagateUnreadCount(account.address if hasattr(account, 'address') else None, folder, treeWidget, 0)
|
self.propagateUnreadCount(account.address if hasattr(account, 'address') else None, folder, treeWidget, 0)
|
||||||
self.loadMessagelist(messagelist, account, folder, searchOption, searchLine)
|
self.loadMessagelist(messagelist, account, folder, searchOption, searchLine)
|
||||||
|
@ -3442,12 +3430,6 @@ class MainWindow(Window):
|
||||||
messageTextedit.setTextColor(QtGui.QColor())
|
messageTextedit.setTextColor(QtGui.QColor())
|
||||||
messageTextedit.setContent(message)
|
messageTextedit.setContent(message)
|
||||||
|
|
||||||
# def messagelistSelect(self, msg):
|
|
||||||
# messageTextedit = self.getCurrentMessageTextedit()
|
|
||||||
# if not messageTextedit:
|
|
||||||
# return
|
|
||||||
# messageTextedit.setContent(msg)
|
|
||||||
|
|
||||||
def tableWidgetAddressBookItemChanged(self, item):
|
def tableWidgetAddressBookItemChanged(self, item):
|
||||||
if item.type == AccountMixin.CHAN:
|
if item.type == AccountMixin.CHAN:
|
||||||
self.rerenderComboBoxSendFrom()
|
self.rerenderComboBoxSendFrom()
|
||||||
|
|
|
@ -41,7 +41,6 @@ class Window(settingsmixin.SMainWindow):
|
||||||
|
|
||||||
# Hide all menu action containers
|
# Hide all menu action containers
|
||||||
for toolbar in (
|
for toolbar in (
|
||||||
self.inboxContextMenuToolbar,
|
|
||||||
self.addressContextMenuToolbarYourIdentities,
|
self.addressContextMenuToolbarYourIdentities,
|
||||||
self.addressContextMenuToolbar,
|
self.addressContextMenuToolbar,
|
||||||
self.addressBookContextMenuToolbar,
|
self.addressBookContextMenuToolbar,
|
||||||
|
|
|
@ -993,68 +993,6 @@ p, li { white-space: pre-wrap; }
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QToolBar" name="inboxContextMenuToolbar">
|
|
||||||
<attribute name="toolBarArea">
|
|
||||||
<enum>TopToolBarArea</enum>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="toolBarBreak">
|
|
||||||
<bool>false</bool>
|
|
||||||
</attribute>
|
|
||||||
<action name="actionReply">
|
|
||||||
<property name="text">
|
|
||||||
<string>Reply to sender</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionReplyChan">
|
|
||||||
<property name="text">
|
|
||||||
<string>Reply to channel</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionAddSenderToAddressBook">
|
|
||||||
<property name="text">
|
|
||||||
<string>Add sender to your Address Book</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionAddSenderToBlackList">
|
|
||||||
<property name="text">
|
|
||||||
<string>Add sender to your Blacklist</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionTrashInboxMessage">
|
|
||||||
<property name="text">
|
|
||||||
<string>Move to Trash</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionUndeleteTrashedMessage">
|
|
||||||
<property name="text">
|
|
||||||
<string>Undelete</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionForceHtml">
|
|
||||||
<property name="text">
|
|
||||||
<string>View HTML code as formatted text</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionSaveMessageAs">
|
|
||||||
<property name="text">
|
|
||||||
<string>Save message as...</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionMarkUnread">
|
|
||||||
<property name="text">
|
|
||||||
<string>Mark Unread</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<addaction name="actionReply"/>
|
|
||||||
<addaction name="actionReplyChan"/>
|
|
||||||
<addaction name="actionAddSenderToAddressBook"/>
|
|
||||||
<addaction name="actionAddSenderToBlackList"/>
|
|
||||||
<addaction name="actionTrashInboxMessage"/>
|
|
||||||
<addaction name="actionUndeleteTrashedMessage"/>
|
|
||||||
<addaction name="actionForceHtml"/>
|
|
||||||
<addaction name="actionSaveMessageAs"/>
|
|
||||||
<addaction name="actionMarkUnread"/>
|
|
||||||
</widget>
|
|
||||||
<widget class="QToolBar" name="addressContextMenuToolbarYourIdentities">
|
<widget class="QToolBar" name="addressContextMenuToolbarYourIdentities">
|
||||||
<attribute name="toolBarArea">
|
<attribute name="toolBarArea">
|
||||||
<enum>TopToolBarArea</enum>
|
<enum>TopToolBarArea</enum>
|
||||||
|
@ -1713,38 +1651,6 @@ p, li { white-space: pre-wrap; }
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
<connection>
|
|
||||||
<sender>tableWidgetInboxSubscriptions</sender>
|
|
||||||
<signal>customContextMenuRequested(QPoint)</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>on_context_menuInbox()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>tableWidgetInboxChans</sender>
|
|
||||||
<signal>customContextMenuRequested(QPoint)</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>on_context_menuInbox()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
<connection>
|
||||||
<sender>tableWidgetAddressBook</sender>
|
<sender>tableWidgetAddressBook</sender>
|
||||||
<signal>customContextMenuRequested(QPoint)</signal>
|
<signal>customContextMenuRequested(QPoint)</signal>
|
||||||
|
@ -1793,150 +1699,6 @@ p, li { white-space: pre-wrap; }
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
<connection>
|
|
||||||
<sender>actionReply</sender>
|
|
||||||
<signal>triggered()</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>on_action_InboxReply</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>-1</x>
|
|
||||||
<y>-1</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>actionReplyChan</sender>
|
|
||||||
<signal>triggered()</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>on_action_InboxReplyChan</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>-1</x>
|
|
||||||
<y>-1</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>actionAddSenderToAddressBook</sender>
|
|
||||||
<signal>triggered()</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>on_action_InboxAddSenderToAddressBook</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>-1</x>
|
|
||||||
<y>-1</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>actionAddSenderToBlackList</sender>
|
|
||||||
<signal>triggered()</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>on_action_InboxAddSenderToBlackList</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>-1</x>
|
|
||||||
<y>-1</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>actionTrashInboxMessage</sender>
|
|
||||||
<signal>triggered()</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>on_action_InboxTrash</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>-1</x>
|
|
||||||
<y>-1</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>actionUndeleteTrashedMessage</sender>
|
|
||||||
<signal>triggered()</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>on_action_TrashUndelete</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>-1</x>
|
|
||||||
<y>-1</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>actionForceHtml</sender>
|
|
||||||
<signal>triggered()</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>on_action_InboxMessageForceHtml</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>-1</x>
|
|
||||||
<y>-1</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>actionSaveMessageAs</sender>
|
|
||||||
<signal>triggered()</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>on_action_InboxSaveMessageAs</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>-1</x>
|
|
||||||
<y>-1</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>actionMarkUnread</sender>
|
|
||||||
<signal>triggered()</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>on_action_InboxMarkUnread</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>-1</x>
|
|
||||||
<y>-1</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
<connection>
|
||||||
<sender>actionNew</sender>
|
<sender>actionNew</sender>
|
||||||
<signal>triggered()</signal>
|
<signal>triggered()</signal>
|
||||||
|
|
|
@ -5,6 +5,8 @@ from PyQt4 import QtCore, QtGui
|
||||||
import account
|
import account
|
||||||
import foldertree
|
import foldertree
|
||||||
import l10n
|
import l10n
|
||||||
|
import queues
|
||||||
|
import settingsmixin
|
||||||
import widgets
|
import widgets
|
||||||
from bmconfigparser import BMConfigParser
|
from bmconfigparser import BMConfigParser
|
||||||
from debug import logger
|
from debug import logger
|
||||||
|
@ -100,7 +102,7 @@ class InboxTableModel(QtCore.QAbstractTableModel):
|
||||||
self.filter = InboxFilter(folder='*', fields=self.fields)
|
self.filter = InboxFilter(folder='*', fields=self.fields)
|
||||||
self.fields = ','.join(self.fields)
|
self.fields = ','.join(self.fields)
|
||||||
self.query = 'SELECT %%s FROM %s ' % self.table
|
self.query = 'SELECT %%s FROM %s ' % self.table
|
||||||
self.sort = ' ORDER BY received DESC'
|
self.order = ' ORDER BY received DESC'
|
||||||
self.column_count = len(self.header)
|
self.column_count = len(self.header)
|
||||||
|
|
||||||
def columnCount(self, parent=QtCore.QModelIndex()):
|
def columnCount(self, parent=QtCore.QModelIndex()):
|
||||||
|
@ -118,7 +120,7 @@ class InboxTableModel(QtCore.QAbstractTableModel):
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setBold(
|
font.setBold(
|
||||||
not sqlQuery(
|
not sqlQuery(
|
||||||
'%s %s %s' % (self.query, self.filter, self.sort) % 'read'
|
'%s %s %s' % (self.query, self.filter, self.order) % 'read'
|
||||||
)[index.row()][0]
|
)[index.row()][0]
|
||||||
)
|
)
|
||||||
return font
|
return font
|
||||||
|
@ -135,7 +137,7 @@ class InboxTableModel(QtCore.QAbstractTableModel):
|
||||||
column = self.attributes[index.column() - len(self.header)]
|
column = self.attributes[index.column() - len(self.header)]
|
||||||
|
|
||||||
result = sqlQuery(
|
result = sqlQuery(
|
||||||
'%s %s %s' % (self.query, self.filter, self.sort) % column
|
'%s %s %s' % (self.query, self.filter, self.order) % column
|
||||||
)[index.row()][0]
|
)[index.row()][0]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -151,6 +153,15 @@ class InboxTableModel(QtCore.QAbstractTableModel):
|
||||||
if role == QtCore.Qt.DisplayRole:
|
if role == QtCore.Qt.DisplayRole:
|
||||||
return self.header[column]['label']
|
return self.header[column]['label']
|
||||||
|
|
||||||
|
def sort(self, column, order):
|
||||||
|
current_order = self.order
|
||||||
|
self.order = ' ORDER BY %s %s' % (
|
||||||
|
self.header[column]['field'],
|
||||||
|
'ASC' if order == QtCore.Qt.AscendingOrder else 'DESC'
|
||||||
|
)
|
||||||
|
if self.order != current_order:
|
||||||
|
self.emit(QtCore.SIGNAL("layoutChanged()"))
|
||||||
|
|
||||||
def setRead(self, row, read=True):
|
def setRead(self, row, read=True):
|
||||||
msgid = self.data(self.createIndex(row, 3))
|
msgid = self.data(self.createIndex(row, 3))
|
||||||
sqlExecute('UPDATE inbox SET read = ? WHERE msgid = ?', read, msgid)
|
sqlExecute('UPDATE inbox SET read = ? WHERE msgid = ?', read, msgid)
|
||||||
|
@ -169,16 +180,24 @@ class InboxTableModel(QtCore.QAbstractTableModel):
|
||||||
self.emit(QtCore.SIGNAL("layoutChanged()"))
|
self.emit(QtCore.SIGNAL("layoutChanged()"))
|
||||||
|
|
||||||
|
|
||||||
class InboxMessagelist(QtGui.QTableView):
|
class InboxMessagelist(settingsmixin.STableView):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(InboxMessagelist, self).__init__(parent)
|
super(InboxMessagelist, self).__init__(parent)
|
||||||
self.setModel(InboxTableModel())
|
self.setModel(InboxTableModel())
|
||||||
|
self.horizontalHeader().setSortIndicator(2, QtCore.Qt.DescendingOrder)
|
||||||
|
self.loadSettings()
|
||||||
|
|
||||||
|
def contextMenuEvent(self, event):
|
||||||
|
# model = self.model()
|
||||||
|
|
||||||
|
self.menu.exec_(event.globalPos())
|
||||||
|
|
||||||
def currentChanged(self, cur_id, prev_id):
|
def currentChanged(self, cur_id, prev_id):
|
||||||
row = cur_id.row()
|
row = cur_id.row()
|
||||||
|
logger.warning('currentChanged, row: %r', row)
|
||||||
if row and row == prev_id.row():
|
if row and row == prev_id.row():
|
||||||
|
logger.warning('returning because row <= 0')
|
||||||
return
|
return
|
||||||
# what if folder changed?
|
|
||||||
self.model().setRead(row)
|
self.model().setRead(row)
|
||||||
msg = self.model().getMessage(row)
|
msg = self.model().getMessage(row)
|
||||||
self.emit(QtCore.SIGNAL("messageSelected(QString)"), msg)
|
self.emit(QtCore.SIGNAL("messageSelected(QString)"), msg)
|
||||||
|
@ -194,12 +213,92 @@ class InboxMessagelist(QtGui.QTableView):
|
||||||
if cur_folder.address:
|
if cur_folder.address:
|
||||||
update['toaddress'] = cur_folder.address
|
update['toaddress'] = cur_folder.address
|
||||||
self.model().updateFilter(update)
|
self.model().updateFilter(update)
|
||||||
|
|
||||||
self.selectRow(0)
|
self.selectRow(0)
|
||||||
|
|
||||||
|
def init_context(self, control):
|
||||||
|
self.menu = QtGui.QMenu(self)
|
||||||
|
self.menu.addAction(control.actionForceHtml)
|
||||||
|
self.menu.addAction(control.actionMarkUnread)
|
||||||
|
self.menu.addSeparator()
|
||||||
|
if control.AccountType == foldertree.AccountMixin.CHAN:
|
||||||
|
self.menu.addAction(control.actionReplyChan)
|
||||||
|
self.menu.addAction(control.actionReply)
|
||||||
|
self.menu.addAction(control.actionAddSenderToAddressbook)
|
||||||
|
self.menu.addAction(control.actionClipboard)
|
||||||
|
self.menu.addSeparator()
|
||||||
|
self.menu.addAction(control.actionAddSenderToBlacklist)
|
||||||
|
self.menu.addSeparator()
|
||||||
|
self.menu.addAction(control.actionSaveMessageAs)
|
||||||
|
|
||||||
|
# Menu action handlers
|
||||||
|
def on_actionReply(self, reply_type=None):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def on_actionReplyChan(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def on_actionAddSenderToAddressbook(self):
|
||||||
|
current = self.selectionModel().currentIndex()
|
||||||
|
model = self.model()
|
||||||
|
logger.warning(
|
||||||
|
'Address at current row: %s',
|
||||||
|
model.data(model.createIndex(current.row(), 0)))
|
||||||
|
|
||||||
|
def on_actionAddSenderToBlacklist(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def on_actionTrash(self):
|
||||||
|
selection = self.selectedIndexes()
|
||||||
|
model = self.model()
|
||||||
|
for i in selection:
|
||||||
|
logger.warning(
|
||||||
|
'Should trash %s', model.data(model.createIndex(i.row(), 3)))
|
||||||
|
|
||||||
|
def on_actionTrashUndelete(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def on_actionForceHtml(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def on_actionSaveMessageAs(self):
|
||||||
|
model = self.model()
|
||||||
|
current = self.selectionModel().currentIndex()
|
||||||
|
defaultFilename = ''.join(
|
||||||
|
c for c in model.data(model.createIndex(current.row(), 1))
|
||||||
|
if c.isalnum()
|
||||||
|
) + '.txt'
|
||||||
|
filename = QtGui.QFileDialog.getSaveFileName(
|
||||||
|
self, _translate("MainWindow", "Save As..."), defaultFilename,
|
||||||
|
"Text files (*.txt);;All files (*.*)")
|
||||||
|
if filename == '':
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
with open(filename, 'w') as output:
|
||||||
|
output.write(model.getMessage(current.row()))
|
||||||
|
except Exception:
|
||||||
|
logger.exception('Message not saved', exc_info=True)
|
||||||
|
queues.UISignalQueue.put((
|
||||||
|
'updateStatusBar',
|
||||||
|
_translate("MainWindow", "Write error.")
|
||||||
|
))
|
||||||
|
|
||||||
|
def on_actionMarkUnread(self):
|
||||||
|
for i in self.selectedIndexes():
|
||||||
|
if i.column():
|
||||||
|
break
|
||||||
|
self.model().setRead(i.row(), False)
|
||||||
|
|
||||||
|
def on_actionClipboard(self):
|
||||||
|
current = self.selectionModel().currentIndex()
|
||||||
|
clipboard = QtGui.QApplication.clipboard()
|
||||||
|
clipboard.setText(self.model().data(current))
|
||||||
|
|
||||||
|
|
||||||
class TreeWidgetIdentities(QtGui.QTreeWidget):
|
class TreeWidgetIdentities(QtGui.QTreeWidget):
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
super(TreeWidgetIdentities, self).__init__(parent)
|
super(TreeWidgetIdentities, self).__init__(parent)
|
||||||
|
self.account_type = None
|
||||||
folders = ('inbox', 'new', 'sent', 'trash')
|
folders = ('inbox', 'new', 'sent', 'trash')
|
||||||
accounts = account.getSortedAccounts() + account.getSortedSubscriptions().keys()
|
accounts = account.getSortedAccounts() + account.getSortedSubscriptions().keys()
|
||||||
top = foldertree.Ui_AddressWidget(self, 0, None, 0, True)
|
top = foldertree.Ui_AddressWidget(self, 0, None, 0, True)
|
||||||
|
@ -214,6 +313,7 @@ class TreeWidgetIdentities(QtGui.QTreeWidget):
|
||||||
self.header().setSortIndicator(0, QtCore.Qt.AscendingOrder)
|
self.header().setSortIndicator(0, QtCore.Qt.AscendingOrder)
|
||||||
|
|
||||||
def filterAccountType(self, account_type):
|
def filterAccountType(self, account_type):
|
||||||
|
self.account_type = account_type
|
||||||
header = self.headerItem()
|
header = self.headerItem()
|
||||||
if account_type == foldertree.AccountMixin.CHAN:
|
if account_type == foldertree.AccountMixin.CHAN:
|
||||||
header.setText(0, _translate("MainWindow", "Chans"))
|
header.setText(0, _translate("MainWindow", "Chans"))
|
||||||
|
@ -223,9 +323,17 @@ class TreeWidgetIdentities(QtGui.QTreeWidget):
|
||||||
header.setIcon(0, QtGui.QIcon(":/newPrefix/images/subscriptions.png"))
|
header.setIcon(0, QtGui.QIcon(":/newPrefix/images/subscriptions.png"))
|
||||||
for i in xrange(self.topLevelItemCount()):
|
for i in xrange(self.topLevelItemCount()):
|
||||||
item = self.topLevelItem(i)
|
item = self.topLevelItem(i)
|
||||||
|
if not item.type and account_type in (
|
||||||
|
foldertree.AccountMixin.ALL,
|
||||||
|
foldertree.AccountMixin.NORMAL
|
||||||
|
):
|
||||||
|
continue
|
||||||
if item.type != account_type:
|
if item.type != account_type:
|
||||||
self.setItemHidden(item, True)
|
self.setItemHidden(item, True)
|
||||||
|
|
||||||
|
def add(self):
|
||||||
|
logger.warning('Should add an item of type %s', self.account_type)
|
||||||
|
|
||||||
|
|
||||||
class MessagelistControl(QtGui.QWidget):
|
class MessagelistControl(QtGui.QWidget):
|
||||||
@QtCore.pyqtProperty(int)
|
@QtCore.pyqtProperty(int)
|
||||||
|
@ -252,4 +360,15 @@ class MessagelistControl(QtGui.QWidget):
|
||||||
self.verticalSplitter.setCollapsible(2, False)
|
self.verticalSplitter.setCollapsible(2, False)
|
||||||
self.verticalSplitter.handle(1).setEnabled(False)
|
self.verticalSplitter.handle(1).setEnabled(False)
|
||||||
|
|
||||||
|
if self.AccountType == foldertree.AccountMixin.CHAN:
|
||||||
|
button_label = _translate("MainWindow", "Add Chan")
|
||||||
|
elif self.AccountType == foldertree.AccountMixin.SUBSCRIPTION:
|
||||||
|
button_label = _translate("MainWindow", "Add new Subscription")
|
||||||
|
else:
|
||||||
|
button_label = _translate("MainWindow", "New Identity")
|
||||||
|
self.buttonAdd.setText(button_label)
|
||||||
|
|
||||||
self.treeWidget.filterAccountType(self.AccountType)
|
self.treeWidget.filterAccountType(self.AccountType)
|
||||||
|
|
||||||
|
self.inboxContextMenuToolbar.setVisible(False)
|
||||||
|
self.messagelistInbox.init_context(self)
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="buttonNew">
|
<widget class="QPushButton" name="buttonAdd">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>200</width>
|
<width>200</width>
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">New</string>
|
<string notr="true">Add</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -119,9 +119,6 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="InboxMessagelist" name="messagelistInbox">
|
<widget class="InboxMessagelist" name="messagelistInbox">
|
||||||
<property name="contextMenuPolicy">
|
|
||||||
<enum>Qt::CustomContextMenu</enum>
|
|
||||||
</property>
|
|
||||||
<property name="editTriggers">
|
<property name="editTriggers">
|
||||||
<set>QAbstractItemView::NoEditTriggers</set>
|
<set>QAbstractItemView::NoEditTriggers</set>
|
||||||
</property>
|
</property>
|
||||||
|
@ -153,7 +150,7 @@
|
||||||
<number>27</number>
|
<number>27</number>
|
||||||
</attribute>
|
</attribute>
|
||||||
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
|
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</attribute>
|
</attribute>
|
||||||
<attribute name="horizontalHeaderStretchLastSection">
|
<attribute name="horizontalHeaderStretchLastSection">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
@ -188,6 +185,74 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
<widget class="QToolBar" name="inboxContextMenuToolbar">
|
||||||
|
<attribute name="visibility">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="toolBarBreak">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
<action name="actionReply">
|
||||||
|
<property name="text">
|
||||||
|
<string>Reply to sender</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionReplyChan">
|
||||||
|
<property name="text">
|
||||||
|
<string>Reply to channel</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionAddSenderToAddressbook">
|
||||||
|
<property name="text">
|
||||||
|
<string>Add sender to your Addressbook</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionAddSenderToBlacklist">
|
||||||
|
<property name="text">
|
||||||
|
<string>Add sender to your Blacklist</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionTrash">
|
||||||
|
<property name="text">
|
||||||
|
<string>Move to Trash</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionTrashUndelete">
|
||||||
|
<property name="text">
|
||||||
|
<string>Undelete</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionForceHtml">
|
||||||
|
<property name="text">
|
||||||
|
<string>View HTML code as formatted text</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionSaveMessageAs">
|
||||||
|
<property name="text">
|
||||||
|
<string>Save message as...</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionMarkUnread">
|
||||||
|
<property name="text">
|
||||||
|
<string>Mark Unread</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionClipboard">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">Copy to clipboard</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<addaction name="actionReply"/>
|
||||||
|
<addaction name="actionReplyChan"/>
|
||||||
|
<addaction name="actionAddSenderToAddressbook"/>
|
||||||
|
<addaction name="actionAddSenderToBlacklist"/>
|
||||||
|
<addaction name="actionTrash"/>
|
||||||
|
<addaction name="actionTrashUndelete"/>
|
||||||
|
<addaction name="actionForceHtml"/>
|
||||||
|
<addaction name="actionSaveMessageAs"/>
|
||||||
|
<addaction name="actionMarkUnread"/>
|
||||||
|
<addaction name="actionClipboard"/>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
@ -221,85 +286,29 @@
|
||||||
<include location="bitmessage_icons.qrc"/>
|
<include location="bitmessage_icons.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<!-- <connection> -->
|
<connection>
|
||||||
<!-- <sender>messagelistInbox</sender> -->
|
<sender>buttonAdd</sender>
|
||||||
<!-- <signal>customContextMenuRequested(QPoint)</signal> -->
|
<signal>clicked()</signal>
|
||||||
<!-- <receiver>MainWindow</receiver> -->
|
<receiver>treeWidget</receiver>
|
||||||
<!-- <slot>on_context_menuInbox()</slot> -->
|
<slot>add</slot>
|
||||||
<!-- <hints> -->
|
</connection>
|
||||||
<!-- <hint type="sourcelabel"> -->
|
|
||||||
<!-- <x>656</x> -->
|
|
||||||
<!-- <y>366</y> -->
|
|
||||||
<!-- </hint> -->
|
|
||||||
<!-- <hint type="destinationlabel"> -->
|
|
||||||
<!-- <x>442</x> -->
|
|
||||||
<!-- <y>289</y> -->
|
|
||||||
<!-- </hint> -->
|
|
||||||
<!-- </hints> -->
|
|
||||||
<!-- </connection> -->
|
|
||||||
<!-- <connection> -->
|
|
||||||
<!-- <sender>pushButtonNewAddress</sender> -->
|
|
||||||
<!-- <signal>clicked()</signal> -->
|
|
||||||
<!-- <receiver>MainWindow</receiver> -->
|
|
||||||
<!-- <slot>click_NewAddressDialog</slot> -->
|
|
||||||
<!-- <hints> -->
|
|
||||||
<!-- <hint type="sourcelabel"> -->
|
|
||||||
<!-- <x>20</x> -->
|
|
||||||
<!-- <y>20</y> -->
|
|
||||||
<!-- </hint> -->
|
|
||||||
<!-- <hint type="destinationlabel"> -->
|
|
||||||
<!-- <x>20</x> -->
|
|
||||||
<!-- <y>20</y> -->
|
|
||||||
<!-- </hint> -->
|
|
||||||
<!-- </hints> -->
|
|
||||||
<!-- </connection> -->
|
|
||||||
<!-- <connection> -->
|
<!-- <connection> -->
|
||||||
<!-- <sender>treeWidgetYourIdentities</sender> -->
|
<!-- <sender>treeWidgetYourIdentities</sender> -->
|
||||||
<!-- <signal>customContextMenuRequested(QPoint)</signal> -->
|
<!-- <signal>customContextMenuRequested(QPoint)</signal> -->
|
||||||
<!-- <receiver>MainWindow</receiver> -->
|
<!-- <receiver>MainWindow</receiver> -->
|
||||||
<!-- <slot>on_context_menuYourIdentities()</slot> -->
|
<!-- <slot>on_context_menuYourIdentities()</slot> -->
|
||||||
<!-- <hints> -->
|
|
||||||
<!-- <hint type="sourcelabel"> -->
|
|
||||||
<!-- <x>20</x> -->
|
|
||||||
<!-- <y>20</y> -->
|
|
||||||
<!-- </hint> -->
|
|
||||||
<!-- <hint type="destinationlabel"> -->
|
|
||||||
<!-- <x>20</x> -->
|
|
||||||
<!-- <y>20</y> -->
|
|
||||||
<!-- </hint> -->
|
|
||||||
<!-- </hints> -->
|
|
||||||
<!-- </connection> -->
|
<!-- </connection> -->
|
||||||
<!-- <connection> -->
|
<!-- <connection> -->
|
||||||
<!-- <sender>inboxSearchLineEdit</sender> -->
|
<!-- <sender>inboxSearchLineEdit</sender> -->
|
||||||
<!-- <signal>returnPressed()</signal> -->
|
<!-- <signal>returnPressed()</signal> -->
|
||||||
<!-- <receiver>MainWindow</receiver> -->
|
<!-- <receiver>MainWindow</receiver> -->
|
||||||
<!-- <slot>inboxSearchLineEditReturnPressed</slot> -->
|
<!-- <slot>inboxSearchLineEditReturnPressed</slot> -->
|
||||||
<!-- <hints> -->
|
|
||||||
<!-- <hint type="sourcelabel"> -->
|
|
||||||
<!-- <x>20</x> -->
|
|
||||||
<!-- <y>20</y> -->
|
|
||||||
<!-- </hint> -->
|
|
||||||
<!-- <hint type="destinationlabel"> -->
|
|
||||||
<!-- <x>20</x> -->
|
|
||||||
<!-- <y>20</y> -->
|
|
||||||
<!-- </hint> -->
|
|
||||||
<!-- </hints> -->
|
|
||||||
<!-- </connection> -->
|
<!-- </connection> -->
|
||||||
<!-- <connection> -->
|
<!-- <connection> -->
|
||||||
<!-- <sender>inboxSearchLineEdit</sender> -->
|
<!-- <sender>inboxSearchLineEdit</sender> -->
|
||||||
<!-- <signal>textChanged(QString)</signal> -->
|
<!-- <signal>textChanged(QString)</signal> -->
|
||||||
<!-- <receiver>MainWindow</receiver> -->
|
<!-- <receiver>MainWindow</receiver> -->
|
||||||
<!-- <slot>inboxSearchLineEditUpdated</slot> -->
|
<!-- <slot>inboxSearchLineEditUpdated</slot> -->
|
||||||
<!-- <hints> -->
|
|
||||||
<!-- <hint type="sourcelabel"> -->
|
|
||||||
<!-- <x>20</x> -->
|
|
||||||
<!-- <y>20</y> -->
|
|
||||||
<!-- </hint> -->
|
|
||||||
<!-- <hint type="destinationlabel"> -->
|
|
||||||
<!-- <x>20</x> -->
|
|
||||||
<!-- <y>20</y> -->
|
|
||||||
<!-- </hint> -->
|
|
||||||
<!-- </hints> -->
|
|
||||||
<!-- </connection> -->
|
<!-- </connection> -->
|
||||||
<connection>
|
<connection>
|
||||||
<sender>treeWidget</sender>
|
<sender>treeWidget</sender>
|
||||||
|
@ -307,22 +316,6 @@
|
||||||
<receiver>messagelistInbox</receiver>
|
<receiver>messagelistInbox</receiver>
|
||||||
<slot>folderChanged</slot>
|
<slot>folderChanged</slot>
|
||||||
</connection>
|
</connection>
|
||||||
<!-- <connection> -->
|
|
||||||
<!-- <sender>treeWidgetYourIdentities</sender> -->
|
|
||||||
<!-- <signal>itemChanged(QTreeWidgetItem*,int)</signal> -->
|
|
||||||
<!-- <receiver>MainWindow</receiver> -->
|
|
||||||
<!-- <slot>treeWidgetItemChanged</slot> -->
|
|
||||||
<!-- <hints> -->
|
|
||||||
<!-- <hint type="sourcelabel"> -->
|
|
||||||
<!-- <x>20</x> -->
|
|
||||||
<!-- <y>20</y> -->
|
|
||||||
<!-- </hint> -->
|
|
||||||
<!-- <hint type="destinationlabel"> -->
|
|
||||||
<!-- <x>20</x> -->
|
|
||||||
<!-- <y>20</y> -->
|
|
||||||
<!-- </hint> -->
|
|
||||||
<!-- </hints> -->
|
|
||||||
<!-- </connection> -->
|
|
||||||
<connection>
|
<connection>
|
||||||
<sender>messagelistInbox</sender>
|
<sender>messagelistInbox</sender>
|
||||||
<signal>messageSelected(QString)</signal>
|
<signal>messageSelected(QString)</signal>
|
||||||
|
@ -339,5 +332,65 @@
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionReply</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>messagelistInbox</receiver>
|
||||||
|
<slot>on_actionReply</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionReplyChan</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>messagelistInbox</receiver>
|
||||||
|
<slot>on_actionReplyChan</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionAddSenderToAddressbook</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>messagelistInbox</receiver>
|
||||||
|
<slot>on_actionAddSenderToAddressbook</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionAddSenderToBlacklist</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>messagelistInbox</receiver>
|
||||||
|
<slot>on_actionAddSenderToBlacklist</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionTrash</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>messagelistInbox</receiver>
|
||||||
|
<slot>on_actionTrash</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionTrashUndelete</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>messagelistInbox</receiver>
|
||||||
|
<slot>on_actionTrashUndelete</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionForceHtml</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>messagelistInbox</receiver>
|
||||||
|
<slot>on_actionForceHtml</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionSaveMessageAs</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>messagelistInbox</receiver>
|
||||||
|
<slot>on_actionSaveMessageAs</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionMarkUnread</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>messagelistInbox</receiver>
|
||||||
|
<slot>on_actionMarkUnread</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>actionClipboard</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>messagelistInbox</receiver>
|
||||||
|
<slot>on_actionClipboard</slot>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -10,6 +10,14 @@ from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
class SettingsMixin(object):
|
class SettingsMixin(object):
|
||||||
"""Mixin for adding geometry and state saving between restarts."""
|
"""Mixin for adding geometry and state saving between restarts."""
|
||||||
|
# def __init__(self, *args):
|
||||||
|
# super(SettingsMixin, self).__init__(*args)
|
||||||
|
# self.loadSettings()
|
||||||
|
|
||||||
|
# def __del__(self):
|
||||||
|
# self.saveSettings()
|
||||||
|
# super(SettingsMixin, self).__del__()
|
||||||
|
|
||||||
def warnIfNoObjectName(self):
|
def warnIfNoObjectName(self):
|
||||||
"""
|
"""
|
||||||
Handle objects which don't have a name. Currently it ignores them. Objects without a name can't have their
|
Handle objects which don't have a name. Currently it ignores them. Objects without a name can't have their
|
||||||
|
@ -81,6 +89,18 @@ class STableWidget(QtGui.QTableWidget, SettingsMixin):
|
||||||
self.writeState(self.horizontalHeader())
|
self.writeState(self.horizontalHeader())
|
||||||
|
|
||||||
|
|
||||||
|
class STableView(QtGui.QTableView, SettingsMixin):
|
||||||
|
"""Table widget with Settings functionality"""
|
||||||
|
# pylint: disable=too-many-ancestors
|
||||||
|
def loadSettings(self):
|
||||||
|
"""Load table settings."""
|
||||||
|
self.readState(self.horizontalHeader())
|
||||||
|
|
||||||
|
def saveSettings(self):
|
||||||
|
"""Save table settings."""
|
||||||
|
self.writeState(self.horizontalHeader())
|
||||||
|
|
||||||
|
|
||||||
class SSplitter(QtGui.QSplitter, SettingsMixin):
|
class SSplitter(QtGui.QSplitter, SettingsMixin):
|
||||||
"""Splitter with Settings functionality."""
|
"""Splitter with Settings functionality."""
|
||||||
def loadSettings(self):
|
def loadSettings(self):
|
||||||
|
|
Reference in New Issue
Block a user