projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
89791e0
)
the inputline is now only disabled if we are not connected to the network or it is...
author
Marcus Eggenberger
<egs@quassel-irc.org>
Tue, 22 Jul 2008 19:28:15 +0000
(21:28 +0200)
committer
Marcus Eggenberger
<egs@quassel-irc.org>
Tue, 22 Jul 2008 19:28:21 +0000
(21:28 +0200)
src/qtui/inputwidget.cpp
patch
|
blob
|
history
diff --git
a/src/qtui/inputwidget.cpp
b/src/qtui/inputwidget.cpp
index
a126717
..
37f8488
100644
(file)
--- a/
src/qtui/inputwidget.cpp
+++ b/
src/qtui/inputwidget.cpp
@@
-55,9
+55,18
@@
void InputWidget::currentChanged(const QModelIndex ¤t, const QModelIndex &
if(current.data(NetworkModel::BufferInfoRole) == previous.data(NetworkModel::BufferInfoRole))
return;
if(current.data(NetworkModel::BufferInfoRole) == previous.data(NetworkModel::BufferInfoRole))
return;
- setNetwork(Client::networkModel()->networkByIndex(current));
+ const Network *net = Client::networkModel()->networkByIndex(current);
+ setNetwork(net);
updateNickSelector();
updateNickSelector();
- ui.inputEdit->setEnabled(current.data(NetworkModel::ItemActiveRole).value<bool>());
+
+ bool enabled = false;
+ if(net) {
+ // disable inputline if it's a channelbuffer we parted from or...
+ enabled = (current.data(NetworkModel::ItemActiveRole).value<bool>() || (current.data(NetworkModel::BufferTypeRole).toInt() != BufferInfo::ChannelBuffer));
+ // ... if we're not connected to the network at all
+ enabled &= net->isConnected();
+ }
+ ui.inputEdit->setEnabled(enabled);
}
void InputWidget::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) {
}
void InputWidget::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) {