summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-03-17 15:00:02 (GMT)
committerKevin Smith <kevin.smith@isode.com>2015-04-10 15:12:53 (GMT)
commit6a2e6d58233cbf40b34f962f2b2f9b1589969e13 (patch)
treeb0a62c32adc64fda30fc024f38acfb2a6da6351e /Swift/QtUI/QtChatWindowFactory.cpp
parentb4e3ecf40ee5fda0ba46f714bd24a6d9f3a4cb5e (diff)
downloadswift-6a2e6d58233cbf40b34f962f2b2f9b1589969e13.zip
swift-6a2e6d58233cbf40b34f962f2b2f9b1589969e13.tar.bz2
Fix keyboard shortcuts for --no-tabs mode
This commit enables the following shortcuts for --no-tabs mode: - CTRL + Tab or CTRL/CMD + PageDown to switch to the next chat window - CTRL + Shift + Tab or CTRL/CMD + PageUp to switch to the previous chat window - CTRL/CMD + W to close the current chat window - ALT + A to switch to the next chat window with active messages Test-Information: Verified that the new shortcuts work as expected and verified that standard mode and netbook mode still work as usual. Change-Id: I3831b6c02f5d664cc8b21d7571e20aed00de89b4
Diffstat (limited to 'Swift/QtUI/QtChatWindowFactory.cpp')
-rw-r--r--Swift/QtUI/QtChatWindowFactory.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/Swift/QtUI/QtChatWindowFactory.cpp b/Swift/QtUI/QtChatWindowFactory.cpp
index 1774653..b9ba89d 100644
--- a/Swift/QtUI/QtChatWindowFactory.cpp
+++ b/Swift/QtUI/QtChatWindowFactory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -10,6 +10,7 @@
#include <qdebug.h>
#include <Swift/QtUI/QtChatTabs.h>
+#include <Swift/QtUI/QtChatTabsBase.h>
#include <Swift/QtUI/QtChatWindow.h>
#include <Swift/QtUI/QtSwiftUtil.h>
#include <Swift/QtUI/QtChatTheme.h>
@@ -21,19 +22,21 @@ namespace Swift {
static const QString SPLITTER_STATE = "mucSplitterState";
static const QString CHAT_TABS_GEOMETRY = "chatTabsGeometry";
-QtChatWindowFactory::QtChatWindowFactory(QtSingleWindow* splitter, SettingsProvider* settings, QtSettingsProvider* qtSettings, QtChatTabs* tabs, const QString& themePath, const std::map<std::string, std::string>& emoticons) : themePath_(themePath), emoticons_(emoticons) {
+QtChatWindowFactory::QtChatWindowFactory(QtSingleWindow* splitter, SettingsProvider* settings, QtSettingsProvider* qtSettings, QtChatTabsBase* tabs, const QString& themePath, const std::map<std::string, std::string>& emoticons) : themePath_(themePath), emoticons_(emoticons) {
qtOnlySettings_ = qtSettings;
settings_ = settings;
tabs_ = tabs;
theme_ = NULL;
+ QtChatTabs* fullTabs = dynamic_cast<QtChatTabs*>(tabs_);
if (splitter) {
- splitter->addWidget(tabs_);
- } else if (tabs_) {
+ assert(fullTabs && "Netbook mode and no-tabs interface is not supported!");
+ splitter->addWidget(fullTabs);
+ } else if (fullTabs) {
QVariant chatTabsGeometryVariant = qtOnlySettings_->getQSettings()->value(CHAT_TABS_GEOMETRY);
if (chatTabsGeometryVariant.isValid()) {
- tabs_->restoreGeometry(chatTabsGeometryVariant.toByteArray());
+ fullTabs->restoreGeometry(chatTabsGeometryVariant.toByteArray());
}
- connect(tabs_, SIGNAL(geometryChanged()), this, SLOT(handleWindowGeometryChanged()));
+ connect(fullTabs, SIGNAL(geometryChanged()), this, SLOT(handleWindowGeometryChanged()));
}
}