Minor UI fixes

- "new" folder consistently appears in chans and "All accounts"
- "Sent" message list sorting fix
- When editing a label, keys.dat is saved and the lineEdit completer
  is updated
- addressbook is updated when adding/deleting a new chan
This commit is contained in:
Peter Šurda 2017-02-14 01:35:32 +01:00
parent 965f3548ac
commit a4b1a781ce
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
3 changed files with 12 additions and 3 deletions

View File

@ -571,6 +571,8 @@ class MyForm(settingsmixin.SMainWindow):
if len(db[toAddress]) > 0:
j = 0
for f, c in db[toAddress].iteritems():
if toAddress is not None and tab == 'messages' and folder == "new":
continue
subwidget = Ui_FolderWidget(widget, j, toAddress, f, c)
if subwidget.folderName not in ["new", "trash", "sent"]:
unread += c
@ -585,7 +587,7 @@ class MyForm(settingsmixin.SMainWindow):
j = 0
unread = 0
for folder in folders:
if toAddress is not None and folder == "new":
if toAddress is not None and tab == 'messages' and folder == "new":
continue
subwidget = Ui_FolderWidget(widget, j, toAddress, folder, db[toAddress][folder])
if subwidget.folderName not in ["new", "trash", "sent"]:
@ -1115,8 +1117,8 @@ class MyForm(settingsmixin.SMainWindow):
toAddress, fromAddress, subject, status, ackdata, lastactiontime = row
self.addMessageListItemSent(tableWidget, toAddress, fromAddress, subject, status, ackdata, lastactiontime)
tableWidget.setSortingEnabled(False)
tableWidget.horizontalHeader().setSortIndicator(3, Qt.DescendingOrder)
tableWidget.setSortingEnabled(True)
tableWidget.horizontalHeaderItem(3).setText(_translate("MainWindow", "Sent", None))
tableWidget.setUpdatesEnabled(True)
@ -3558,6 +3560,7 @@ class MyForm(settingsmixin.SMainWindow):
BMConfigParser().save()
shared.reloadMyAddressHashes()
self.rerenderAddressBook()
self.rerenderComboBoxSendFrom()
if account.type == AccountMixin.NORMAL:
self.rerenderTabTreeMessages()
elif account.type == AccountMixin.CHAN:
@ -3937,6 +3940,11 @@ class MyForm(settingsmixin.SMainWindow):
self.rerenderComboBoxSendFrom()
self.rerenderMessagelistFromLabels()
self.rerenderMessagelistToLabels()
completerList = self.ui.lineEditTo.completer().model().stringList()
for i in range(len(completerList)):
if str(completerList[i]).endswith(" <" + item.address + ">"):
completerList[i] = item.label + " <" + item.address + ">"
stringList = self.ui.lineEditTo.completer().model().setStringList(completerList)
def writeNewAddressToTable(self, label, address, streamNumber):
self.rerenderTabTreeMessages()
@ -3944,6 +3952,7 @@ class MyForm(settingsmixin.SMainWindow):
self.rerenderTabTreeChans()
self.rerenderComboBoxSendFrom()
self.rerenderComboBoxSendFromBroadcast()
self.rerenderAddressBook()
def updateStatusBar(self, data):
if type(data) is tuple or type(data) is list:

View File

@ -442,6 +442,7 @@ class Ui_AddressBookWidgetItem(QtGui.QTableWidgetItem, AccountMixin):
try:
a = BMConfigParser().get(self.address, 'label')
BMConfigParser().set(self.address, 'label', self.label)
BMConfigParser().save()
except:
sqlExecute('''UPDATE addressbook set label=? WHERE address=?''', self.label, self.address)
elif self.type == AccountMixin.SUBSCRIPTION:

View File

@ -39,7 +39,6 @@ class NewChanDialog(QtGui.QDialog, RetranslateMixin):
if len(addressGeneratorReturnValue) > 0 and addressGeneratorReturnValue[0] != 'chan name does not match address':
UISignalQueue.put(('updateStatusBar', _translate("newchandialog", "Successfully created / joined chan %1").arg(str(self.chanPassPhrase.text().toUtf8()))))
self.parent.ui.tabWidget.setCurrentIndex(3)
self.parent.rerenderAddressBook()
self.done(QtGui.QDialog.Accepted)
else:
UISignalQueue.put(('updateStatusBar', _translate("newchandialog", "Chan creation / joining failed")))