+ ui.inputLine->setFocus();
+ currentBuffer = buf;
+}
+
+void MainWidget::enterPressed() {
+ QStringList lines = ui.inputLine->text().split('\n', QString::SkipEmptyParts);
+ foreach(QString msg, lines) {
+ if(msg.isEmpty()) continue;
+ if(currentBuffer) currentBuffer->processUserInput(msg);
+ }
+ ui.inputLine->clear();
+}
+
+// FIXME make this more elegant, we don't need to send a string around...
+void MainWidget::setTopic(QString topic) {
+ Q_UNUSED(topic);
+ if(currentBuffer) {
+ QString title = QString("%1 (%2): \"%3\"").arg(currentBuffer->name()).arg(currentBuffer->networkName()).arg(currentBuffer->topic());
+ ui.topicBar->setContents(title);
+ }