Cooperation/ChatWidget.py

changeset 882
34b86be88bf0
parent 880
52ed20236a1c
child 945
8cd4d08fa9f6
child 1510
e75ecf2bd9dd
equal deleted inserted replaced
881:ff23d907f87b 882:34b86be88bf0
6 """ 6 """
7 Module implementing the chat dialog. 7 Module implementing the chat dialog.
8 """ 8 """
9 9
10 from PyQt4.QtCore import Qt, pyqtSlot, pyqtSignal, QDateTime, QPoint, QFileInfo 10 from PyQt4.QtCore import Qt, pyqtSlot, pyqtSignal, QDateTime, QPoint, QFileInfo
11 from PyQt4.QtGui import QWidget, QColor, QListWidgetItem, QMenu, QFileDialog, QApplication 11 from PyQt4.QtGui import QWidget, QColor, QListWidgetItem, QMenu, QApplication
12 12
13 from E5Gui.E5Application import e5App 13 from E5Gui.E5Application import e5App
14 from E5Gui import E5MessageBox 14 from E5Gui import E5MessageBox, E5FileDialog
15 15
16 from Globals import recentNameHosts 16 from Globals import recentNameHosts
17 17
18 from QScintilla.Editor import Editor 18 from QScintilla.Editor import Editor
19 19
527 """ 527 """
528 Private slot to save the contents of the chat display. 528 Private slot to save the contents of the chat display.
529 """ 529 """
530 txt = self.chatEdit.toPlainText() 530 txt = self.chatEdit.toPlainText()
531 if txt: 531 if txt:
532 fname, selectedFilter = QFileDialog.getSaveFileNameAndFilter( 532 fname, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(
533 self, 533 self,
534 self.trUtf8("Save Chat"), 534 self.trUtf8("Save Chat"),
535 "", 535 "",
536 self.trUtf8("Text Files (*.txt);;All Files (*)"), 536 self.trUtf8("Text Files (*.txt);;All Files (*)"),
537 None, 537 None,
538 QFileDialog.Options(QFileDialog.DontConfirmOverwrite | 538 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))
539 QFileDialog.DontUseNativeDialog))
540 if fname: 539 if fname:
541 ext = QFileInfo(fname).suffix() 540 ext = QFileInfo(fname).suffix()
542 if not ext: 541 if not ext:
543 ex = selectedFilter.split("(*")[1].split(")")[0] 542 ex = selectedFilter.split("(*")[1].split(")")[0]
544 if ex: 543 if ex:

eric ide

mercurial