summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Maudsley <richard.maudsley@isode.com>2014-05-19 11:18:52 (GMT)
committerSwift Review <review@swift.im>2014-07-09 10:19:41 (GMT)
commit05d9e618e4c756e50b633448f0546614a645a13d (patch)
tree5a05e5c2c939c240a58c4aa468af0806a7ed8822 /Swift/QtUI/QtMainWindow.cpp
parentacac7962ba04c083377f62f4265ecc754176f74e (diff)
downloadswift-05d9e618e4c756e50b633448f0546614a645a13d.zip
swift-05d9e618e4c756e50b633448f0546614a645a13d.tar.bz2
Add dialog to send AdHoc's to target specific JID's. Fix multi-item Form rendering.
Test-Information: Use AdHoc bot that presents a multi-item form and check that it is rendered correctly. Check that entering invalid JID and node parameters in the dialog do not cause malfunction. Check that canceling the JID prompt closes the dialog without sending any server commands. Change-Id: I10e6f4c7eccd1a35c8c885d548994b5f57fdbf66
Diffstat (limited to 'Swift/QtUI/QtMainWindow.cpp')
-rw-r--r--Swift/QtUI/QtMainWindow.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/Swift/QtUI/QtMainWindow.cpp b/Swift/QtUI/QtMainWindow.cpp
index 31a8234..1db8c77 100644
--- a/Swift/QtUI/QtMainWindow.cpp
+++ b/Swift/QtUI/QtMainWindow.cpp
@@ -40,6 +40,7 @@
#include <Swift/QtUI/QtLoginWindow.h>
#include <Swift/QtUI/Roster/QtRosterWidget.h>
#include <Swift/QtUI/QtUISettingConstants.h>
+#include <Swift/QtUI/QtAdHocCommandWithJIDWindow.h>
#if defined(SWIFTEN_PLATFORM_MACOSX)
#include <Swift/QtUI/CocoaUIHelpers.h>
#elif defined(SWIFTEN_PLATFORM_WINDOWS)
@@ -50,7 +51,7 @@
namespace Swift {
-QtMainWindow::QtMainWindow(SettingsProvider* settings, UIEventStream* uiEventStream, QtLoginWindow::QtMenus loginMenus, StatusCache* statusCache, bool emoticonsExist) : QWidget(), MainWindow(false), loginMenus_(loginMenus) {
+QtMainWindow::QtMainWindow(SettingsProvider* settings, UIEventStream* uiEventStream, QtLoginWindow::QtMenus loginMenus, StatusCache* statusCache, bool emoticonsExist, bool enableAdHocCommandOnJID) : QWidget(), MainWindow(false), loginMenus_(loginMenus) {
uiEventStream_ = uiEventStream;
settings_ = settings;
setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
@@ -175,6 +176,11 @@ QtMainWindow::QtMainWindow(SettingsProvider* settings, UIEventStream* uiEventStr
chatUserAction_->setShortcutContext(Qt::ApplicationShortcut);
connect(chatUserAction_, SIGNAL(triggered(bool)), this, SLOT(handleChatUserActionTriggered(bool)));
actionsMenu->addAction(chatUserAction_);
+ if (enableAdHocCommandOnJID) {
+ otherAdHocAction_ = new QAction(tr("Run Other Command"), this);
+ connect(otherAdHocAction_, SIGNAL(triggered()), this, SLOT(handleOtherAdHocActionTriggered()));
+ actionsMenu->addAction(otherAdHocAction_);
+ }
serverAdHocMenu_ = new QMenu(tr("Run Server Command"), this);
actionsMenu->addMenu(serverAdHocMenu_);
actionsMenu->addSeparator();
@@ -269,6 +275,10 @@ void QtMainWindow::handleChatUserActionTriggered(bool /*checked*/) {
uiEventStream_->send(event);
}
+void QtMainWindow::handleOtherAdHocActionTriggered() {
+ new QtAdHocCommandWithJIDWindow(uiEventStream_);
+}
+
void QtMainWindow::handleSignOutAction() {
loginMenus_.generalMenu->removeAction(toggleRequestDeliveryReceipts_);
onSignOutRequest();