summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-05-31 17:27:48 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-05-31 17:30:34 (GMT)
commit6aeb44a905b0c1955ea3afe4ea2025370544e699 (patch)
treef5d99af0cd87d628263643dc2aa98353d3d3b78d /Swift/QtUI/QtChatWindow.cpp
parent59f1bfcf315a77834ddbce20cc05892d211ab55c (diff)
downloadswift-contrib-6aeb44a905b0c1955ea3afe4ea2025370544e699.zip
swift-contrib-6aeb44a905b0c1955ea3afe4ea2025370544e699.tar.bz2
Very poor prototype of a MUC invite dialog
Diffstat (limited to 'Swift/QtUI/QtChatWindow.cpp')
-rw-r--r--Swift/QtUI/QtChatWindow.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp
index 52ce701..137c044 100644
--- a/Swift/QtUI/QtChatWindow.cpp
+++ b/Swift/QtUI/QtChatWindow.cpp
@@ -11,18 +11,19 @@
#include "Swift/Controllers/Roster/ContactRosterItem.h"
#include "Roster/QtOccupantListWidget.h"
#include "SwifTools/Linkify.h"
#include "QtChatView.h"
#include "MessageSnippet.h"
#include "SystemMessageSnippet.h"
#include "QtTextEdit.h"
#include "QtSettingsProvider.h"
#include "QtScaledAvatarCache.h"
+#include "QtInviteToChatWindow.h"
#include <Swiften/StringCodecs/Base64.h>
#include "SwifTools/TabComplete.h"
#include <Swift/Controllers/UIEvents/UIEventStream.h>
#include <Swift/Controllers/UIEvents/SendFileUIEvent.h>
#include <Swift/Controllers/UIEvents/JoinMUCUIEvent.h>
#include "QtChatWindowJSBridge.h"
#include <boost/cstdint.hpp>
@@ -837,23 +838,19 @@ void QtChatWindow::handleActionButtonClicked() {
msgBox.setText(tr("Are you sure you want to destroy the room?"));
msgBox.setInformativeText(tr("This will destroy the room."));
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::No);
if (msgBox.exec() == QMessageBox::Yes) {
onDestroyRequest();
}
}
else if (result == invite) {
- bool ok;
- QString jid = QInputDialog::getText(this, tr("Enter person's address"), tr("Address:"), QLineEdit::Normal, "", &ok);
- if (ok) {
- onInvitePersonToThisMUCRequest(JID(Q2PSTRING(jid)), "");
- }
+ onInvitePersonToThisMUCRequest();
}
}
void QtChatWindow::handleAffiliationEditorAccepted() {
onChangeAffiliationsRequest(affiliationEditor_->getChanges());
}
void QtChatWindow::setAffiliations(MUCOccupant::Affiliation affiliation, const std::vector<JID>& jids) {
if (!affiliationEditor_) return;
@@ -902,10 +899,16 @@ void QtChatWindow::addMUCInvitation(const std::string& senderName, const JID& ji
}
QString qAvatarPath = "qrc:/icons/avatar.png";
messageLog_->addMessage(boost::shared_ptr<ChatSnippet>(new MessageSnippet(htmlString, Qt::escape(P2QSTRING(senderName)), B2QDATE(boost::posix_time::second_clock::local_time()), qAvatarPath, false, appendToPrevious, theme_, id)));
previousMessageWasSelf_ = false;
previousSenderName_ = P2QSTRING(senderName);
previousMessageKind_ = PreviousMessageWasMUCInvite;
}
+
+InviteToChatWindow* QtChatWindow::createInviteToChatWindow() {
+ return new QtInviteToChatWindow(this);
+}
+
+
}