V0.6 #852

Merged
Atheros1 merged 399 commits from v0.6 into master 2016-05-03 01:58:38 +02:00
3 changed files with 29 additions and 4 deletions
Showing only changes of commit 9353e8eff7 - Show all commits

View File

@ -2274,7 +2274,7 @@ class MyForm(settingsmixin.SMainWindow):
self.ui.comboBoxSendFrom.setCurrentIndex(0)
self.ui.lineEditTo.setText('')
self.ui.lineEditSubject.setText('')
self.ui.textEditMessage.setText('')
self.ui.textEditMessage.reset()
if self.replyFromTab is not None:
self.ui.tabWidget.setCurrentIndex(self.replyFromTab)
self.replyFromTab = None
@ -2324,7 +2324,7 @@ class MyForm(settingsmixin.SMainWindow):
self.ui.comboBoxSendFromBroadcast.setCurrentIndex(0)
self.ui.lineEditSubjectBroadcast.setText('')
self.ui.textEditMessageBroadcast.setText('')
self.ui.textEditMessageBroadcast.reset()
self.ui.tabWidget.setCurrentIndex(1)
self.ui.tableWidgetInboxSubscriptions.setCurrentCell(0, 0)
self.statusBar().showMessage(_translate(

View File

@ -9,6 +9,7 @@
from PyQt4 import QtCore, QtGui
from messageview import MessageView
from messagecompose import MessageCompose
import settingsmixin
try:
@ -232,7 +233,7 @@ class Ui_MainWindow(object):
self.gridLayout_2_Widget = QtGui.QWidget()
self.gridLayout_2_Widget.setLayout(self.gridLayout_2)
self.verticalSplitter_5.addWidget(self.gridLayout_2_Widget)
self.textEditMessage = QtGui.QTextEdit(self.sendDirect)
self.textEditMessage = MessageCompose(self.sendDirect)
self.textEditMessage.setObjectName(_fromUtf8("textEditMessage"))
self.verticalSplitter_5.addWidget(self.textEditMessage)
self.verticalSplitter_5.setStretchFactor(0, 0)
@ -268,7 +269,7 @@ class Ui_MainWindow(object):
self.gridLayout_5_Widget = QtGui.QWidget()
self.gridLayout_5_Widget.setLayout(self.gridLayout_5)
self.verticalSplitter_6.addWidget(self.gridLayout_5_Widget)
self.textEditMessageBroadcast = QtGui.QTextEdit(self.sendBroadcast)
self.textEditMessageBroadcast = MessageCompose(self.sendBroadcast)
self.textEditMessageBroadcast.setObjectName(_fromUtf8("textEditMessageBroadcast"))
self.verticalSplitter_6.addWidget(self.textEditMessageBroadcast)
self.verticalSplitter_6.setStretchFactor(0, 0)

View File

@ -0,0 +1,24 @@
from PyQt4 import QtCore, QtGui
class MessageCompose(QtGui.QTextEdit):
def __init__(self, parent = 0):
super(MessageCompose, self).__init__(parent)
self.setAcceptRichText(False) # we'll deal with this later when we have a new message format
self.defaultFontPointSize = self.currentFont().pointSize()
def wheelEvent(self, event):
if (QtGui.QApplication.queryKeyboardModifiers() & QtCore.Qt.ControlModifier) == QtCore.Qt.ControlModifier and event.orientation() == QtCore.Qt.Vertical:
numDegrees = event.delta() / 8
numSteps = numDegrees / 15
zoomDiff = numSteps + self.currentFont().pointSize() - self.defaultFontPointSize
if numSteps > 0:
self.zoomIn(numSteps)
else:
self.zoomOut(-numSteps)
QtGui.QApplication.activeWindow().statusBar().showMessage(QtGui.QApplication.translate("MainWindow", "Zoom level %1").arg(str(zoomDiff)))
# super will actually automatically take care of zooming
super(MessageCompose, self).wheelEvent(event)
def reset(self):
self.setText('')