projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Properly stop #nnn from being clickable
[quassel.git]
/
src
/
qtui
/
topicwidget.cpp
diff --git
a/src/qtui/topicwidget.cpp
b/src/qtui/topicwidget.cpp
index
7d2d90b
..
cc66bd4
100644
(file)
--- a/
src/qtui/topicwidget.cpp
+++ b/
src/qtui/topicwidget.cpp
@@
-23,12
+23,15
@@
#include <QDebug>
#include "client.h"
#include <QDebug>
#include "client.h"
+#include "iconloader.h"
#include "networkmodel.h"
TopicWidget::TopicWidget(QWidget *parent)
: AbstractItemView(parent)
{
ui.setupUi(this);
#include "networkmodel.h"
TopicWidget::TopicWidget(QWidget *parent)
: AbstractItemView(parent)
{
ui.setupUi(this);
+ ui.topicEditButton->setPixmap(BarIcon("edit-rename"));
+
ui.topicLineEdit->hide();
ui.topicLineEdit->installEventFilter(this);
ui.topicLabel->show();
ui.topicLineEdit->hide();
ui.topicLineEdit->installEventFilter(this);
ui.topicLabel->show();
@@
-51,7
+54,7
@@
void TopicWidget::dataChanged(const QModelIndex &topLeft, const QModelIndex &bot
void TopicWidget::setTopic(const QString &newtopic) {
if(_topic == newtopic)
return;
void TopicWidget::setTopic(const QString &newtopic) {
if(_topic == newtopic)
return;
-
+
_topic = newtopic;
ui.topicLabel->setText(newtopic);
ui.topicLineEdit->setText(newtopic);
_topic = newtopic;
ui.topicLabel->setText(newtopic);
ui.topicLineEdit->setText(newtopic);
@@
-62,7
+65,10
@@
void TopicWidget::on_topicLineEdit_returnPressed() {
QModelIndex currentIdx = currentIndex();
if(currentIdx.isValid() && currentIdx.data(NetworkModel::BufferTypeRole) == BufferInfo::ChannelBuffer) {
BufferInfo bufferInfo = currentIdx.data(NetworkModel::BufferInfoRole).value<BufferInfo>();
QModelIndex currentIdx = currentIndex();
if(currentIdx.isValid() && currentIdx.data(NetworkModel::BufferTypeRole) == BufferInfo::ChannelBuffer) {
BufferInfo bufferInfo = currentIdx.data(NetworkModel::BufferInfoRole).value<BufferInfo>();
- Client::userInput(bufferInfo, QString("/topic %1").arg(ui.topicLineEdit->text()));
+ if(ui.topicLineEdit->text().isEmpty())
+ Client::userInput(bufferInfo, QString("/quote TOPIC %1 :").arg(bufferInfo.bufferName()));
+ else
+ Client::userInput(bufferInfo, QString("/topic %1").arg(ui.topicLineEdit->text()));
}
switchPlain();
}
}
switchPlain();
}
@@
-110,6
+116,6
@@
bool TopicWidget::eventFilter(QObject *obj, QEvent *event) {
switchPlain();
return true;
}
switchPlain();
return true;
}
-
+
return false;
}
return false;
}