def forumReply(om_gui): ''' reply to an item ''' item = om_gui.ui.forum_treeWidget.currentItem() heading = item.text(0) if heading[:2] != "re": heading = "re. " + heading Dialog = QtGui.QDialog(om_gui) dl = Ui_forumPost.Ui_Dialog() dl.setupUi(Dialog) dl.topic_lineEdit.setText(heading) dl.from_comboBox.addItems([localsettings.operator, "Anon"] + localsettings.allowed_logins) dl.to_comboBox.addItems(["ALL"] + localsettings.allowed_logins) if Dialog.exec_(): parentix = int(item.text(1)) post = forum.post() post.parent_ix = parentix post.topic = dl.topic_lineEdit.text().toAscii() post.comment = dl.comment_textEdit.toPlainText().toAscii() post.inits = dl.from_comboBox.currentText() post.recipient = dl.to_comboBox.currentText() forum.commitPost(post) loadForum(om_gui)
def forumNewTopic(om_gui): ''' create a new post ''' Dialog = QtGui.QDialog(om_gui) dl = Ui_forumPost.Ui_Dialog() dl.setupUi(Dialog) dl.from_comboBox.addItems([localsettings.operator, "Anon"] + localsettings.allowed_logins) dl.to_comboBox.addItems(["ALL"] + localsettings.allowed_logins) while True: if Dialog.exec_(): if dl.topic_lineEdit.text() == "": om_gui.advise("Please set a topic", 1) else: break else: return post = forum.post() post.topic = dl.topic_lineEdit.text().toAscii() post.comment = dl.comment_textEdit.toPlainText().toAscii() post.inits = dl.from_comboBox.currentText() if dl.to_comboBox.currentIndex != 0: post.recipient = dl.to_comboBox.currentText() forum.commitPost(post) loadForum(om_gui)
def forumReply(self): """ reply to an item """ self.apply_new_reads() item = self.tree_widget.currentItem() post = item.data(0, QtCore.Qt.UserRole) heading = post.topic if heading[:2] != "re": heading = "re. " + heading Dialog = QtWidgets.QDialog(self) dl = Ui_forumPost.Ui_Dialog() dl.setupUi(Dialog) dl.topic_lineEdit.setText(heading) dl.to_comboBox.addItems([_("EVERYBODY")] + localsettings.allowed_logins) if Dialog.exec_(): newpost = forum.ForumPost() newpost.parent_ix = post.ix newpost.topic = dl.topic_lineEdit.text() newpost.comment = dl.comment_textEdit.toPlainText() newpost.inits = self.forum_poster() newpost.recipient = dl.to_comboBox.currentText() ix = forum.commitPost(newpost) self.read_ids.add(ix) self.loadForum()
def forumNewTopic(self): """ create a new post """ self.apply_new_reads() Dialog = QtWidgets.QDialog(self) dl = Ui_forumPost.Ui_Dialog() dl.setupUi(Dialog) dl.to_comboBox.addItems([_("EVERYBODY")] + localsettings.allowed_logins) while True: if Dialog.exec_(): if dl.topic_lineEdit.text() == "": self.advise(_("Please set a topic")) else: break else: return post = forum.ForumPost() post.topic = dl.topic_lineEdit.text() post.comment = dl.comment_textEdit.toPlainText() post.inits = self.forum_poster() if dl.to_comboBox.currentIndex != 0: post.recipient = dl.to_comboBox.currentText() ix = forum.commitPost(post) self.read_ids.add(ix) self.loadForum()
def forumReply(self): ''' reply to an item ''' self.apply_new_reads() item = self.tree_widget.currentItem() post = item.data(0, QtCore.Qt.UserRole) heading = post.topic if heading[:2] != "re": heading = "re. " + heading Dialog = QtWidgets.QDialog(self) dl = Ui_forumPost.Ui_Dialog() dl.setupUi(Dialog) dl.topic_lineEdit.setText(heading) dl.to_comboBox.addItems([_("EVERYBODY")] + localsettings.allowed_logins) if Dialog.exec_(): newpost = forum.ForumPost() newpost.parent_ix = post.ix newpost.topic = dl.topic_lineEdit.text() newpost.comment = dl.comment_textEdit.toPlainText() newpost.inits = self.forum_poster() newpost.recipient = dl.to_comboBox.currentText() ix = forum.commitPost(newpost) self.read_ids.add(ix) self.loadForum()
def forumNewTopic(self): ''' create a new post ''' self.apply_new_reads() Dialog = QtWidgets.QDialog(self) dl = Ui_forumPost.Ui_Dialog() dl.setupUi(Dialog) dl.to_comboBox.addItems([_("EVERYBODY")] + localsettings.allowed_logins) while True: if Dialog.exec_(): if dl.topic_lineEdit.text() == "": self.advise(_("Please set a topic")) else: break else: return post = forum.ForumPost() post.topic = dl.topic_lineEdit.text() post.comment = dl.comment_textEdit.toPlainText() post.inits = self.forum_poster() if dl.to_comboBox.currentIndex != 0: post.recipient = dl.to_comboBox.currentText() ix = forum.commitPost(post) self.read_ids.add(ix) self.loadForum()