X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fnetworkmodelcontroller.cpp;h=ac2ab6607ae2a4e8829fa67da11dbaaae6106d68;hp=1f37123a1dccffce040014adffdbde4fc34cc4b3;hb=c351c94e52a01571c34a18ddb5947b9e1f771d8c;hpb=f1f360c9b9bbfe4c494879f024f47cbfce6dafe9
diff --git a/src/uisupport/networkmodelcontroller.cpp b/src/uisupport/networkmodelcontroller.cpp
index 1f37123a..ac2ab660 100644
--- a/src/uisupport/networkmodelcontroller.cpp
+++ b/src/uisupport/networkmodelcontroller.cpp
@@ -153,9 +153,18 @@ void NetworkModelController::removeBuffers(const QModelIndexList &indexList) {
if(inactive.count()) {
msg = tr("Do you want to delete the following buffer(s) permanently?", 0, inactive.count());
msg += "
";
- foreach(BufferInfo info, inactive)
- msg += QString("- %1
").arg(info.bufferName());
+ int count = 0;
+ foreach(BufferInfo info, inactive) {
+ if(count < 10) {
+ msg += QString("- %1
").arg(info.bufferName());
+ count++;
+ }
+ else
+ break;
+ }
msg += "
";
+ if(count > 9 && inactive.size() - count != 0)
+ msg += tr("...and %1 more
").arg(inactive.size() - count);
msg += tr("Note: This will delete all related data, including all backlog data, from the core's database and cannot be undone.");
if(inactive.count() != indexList.count())
msg += tr("
Active channel buffers cannot be deleted, please part the channel first.");
@@ -329,15 +338,20 @@ void NetworkModelController::handleGeneralAction(ActionType type, QAction *actio
switch(type) {
case JoinChannel: {
QString channelName = contextItem();
+ QString channelPassword;
if(channelName.isEmpty()) {
JoinDlg dlg(indexList().first());
if(dlg.exec() == QDialog::Accepted) {
channelName = dlg.channelName();
networkId = dlg.networkId();
+ channelPassword = dlg.channelPassword();
}
}
if(!channelName.isEmpty()) {
- Client::instance()->userInput(BufferInfo::fakeStatusBuffer(networkId), QString("/JOIN %1").arg(channelName));
+ if(!channelPassword.isEmpty())
+ Client::instance()->userInput(BufferInfo::fakeStatusBuffer(networkId), QString("/JOIN %1 %2").arg(channelName).arg(channelPassword));
+ else
+ Client::instance()->userInput(BufferInfo::fakeStatusBuffer(networkId), QString("/JOIN %1").arg(channelName));
}
break;
}
@@ -379,8 +393,8 @@ void NetworkModelController::handleNickAction(ActionType type, QAction *action)
case NickCtcpTime:
Client::userInput(bufferInfo, QString("/CTCP %1 TIME").arg(nick));
break;
- case NickCtcpFinger:
- Client::userInput(bufferInfo, QString("/CTCP %1 FINGER").arg(nick));
+ case NickCtcpClientinfo:
+ Client::userInput(bufferInfo, QString("/CTCP %1 CLIENTINFO").arg(nick));
break;
case NickOp:
Client::userInput(bufferInfo, QString("/OP %1").arg(nick));
@@ -388,6 +402,12 @@ void NetworkModelController::handleNickAction(ActionType type, QAction *action)
case NickDeop:
Client::userInput(bufferInfo, QString("/DEOP %1").arg(nick));
break;
+ case NickHalfop:
+ Client::userInput(bufferInfo, QString("/HALFOP %1").arg(nick));
+ break;
+ case NickDehalfop:
+ Client::userInput(bufferInfo, QString("/DEHALFOP %1").arg(nick));
+ break;
case NickVoice:
Client::userInput(bufferInfo, QString("/VOICE %1").arg(nick));
break;
@@ -405,10 +425,8 @@ void NetworkModelController::handleNickAction(ActionType type, QAction *action)
Client::userInput(bufferInfo, QString("/KICK %1").arg(nick));
break;
case NickSwitchTo:
- Client::bufferModel()->switchToBuffer(findQueryBuffer(networkId, nick));
- break;
case NickQuery:
- Client::userInput(bufferInfo, QString("/QUERY %1").arg(nick));
+ Client::bufferModel()->switchToOrStartQuery(networkId, nick);
break;
case NickIgnoreUser:
{
@@ -476,12 +494,15 @@ NetworkModelController::JoinDlg::JoinDlg(const QModelIndex &index, QWidget *pare
layout->addWidget(networks = new QComboBox, 0, 1);
layout->addWidget(new QLabel(tr("Channel:")), 1, 0);
layout->addWidget(channel = new QLineEdit, 1, 1);
- layout->addWidget(buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel), 2, 0, 1, 2);
+ layout->addWidget(new QLabel(tr("Password:")), 2, 0);
+ layout->addWidget(password = new QLineEdit, 2, 1);
+ layout->addWidget(buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel), 3, 0, 1, 2);
setLayout(layout);
channel->setFocus();
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
networks->setInsertPolicy(QComboBox::InsertAlphabetically);
+ password->setEchoMode(QLineEdit::Password);
connect(buttonBox, SIGNAL(accepted()), SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), SLOT(reject()));
@@ -513,6 +534,10 @@ QString NetworkModelController::JoinDlg::channelName() const {
return channel->text();
}
+QString NetworkModelController::JoinDlg::channelPassword() const {
+ return password->text();
+}
+
void NetworkModelController::JoinDlg::on_channel_textChanged(const QString &text) {
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!text.isEmpty());
}