Pressing enter in the topic line now sets the channel topic.
[quassel.git] / src / qtui / topicwidget.cpp
index ea319be..40e7ae8 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005/06 by the Quassel IRC Team                         *
+ *   Copyright (C) 2005/06 by the Quassel Project                          *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -28,13 +28,12 @@ TopicWidget::TopicWidget(QWidget *parent)
   ui.setupUi(this);
 }
 
-QString TopicWidget::topic() const {
-  return ui.topicLineEdit->text();
-}
-
 void TopicWidget::setTopic(const QString &newtopic) {
   ui.topicLineEdit->setText(newtopic);
+  ui.topicLineEdit->setCursorPosition(0);
 }
 
-TopicWidget::~TopicWidget() {
+void TopicWidget::on_topicLineEdit_returnPressed() {
+  ui.topicLineEdit->setCursorPosition(0);
+  emit topicChanged(topic());
 }