summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtChatTabs.cpp4
-rw-r--r--Swift/QtUI/QtChatTabs.h1
-rw-r--r--Swift/QtUI/QtChatWindowFactory.cpp15
-rw-r--r--Swift/QtUI/QtChatWindowFactory.h11
-rw-r--r--Swift/QtUI/QtSingleWindow.cpp16
-rw-r--r--Swift/QtUI/QtSingleWindow.h2
6 files changed, 36 insertions, 13 deletions
diff --git a/Swift/QtUI/QtChatTabs.cpp b/Swift/QtUI/QtChatTabs.cpp
index e37803e..6d12d80 100644
--- a/Swift/QtUI/QtChatTabs.cpp
+++ b/Swift/QtUI/QtChatTabs.cpp
@@ -251,7 +251,9 @@ void QtChatTabs::handleTabTitleUpdated(QWidget* widget) {
std::string current(Q2PSTRING(qobject_cast<QtTabbable*>(tabs_->currentWidget())->windowTitle()));
ChatMessageSummarizer summary;
- setWindowTitle(summary.getSummary(current, unreads).c_str());
+ QString title = summary.getSummary(current, unreads).c_str();
+ setWindowTitle(title);
+ emit onTitleChanged(title);
}
void QtChatTabs::flash() {
diff --git a/Swift/QtUI/QtChatTabs.h b/Swift/QtUI/QtChatTabs.h
index 233c574..35f426b 100644
--- a/Swift/QtUI/QtChatTabs.h
+++ b/Swift/QtUI/QtChatTabs.h
@@ -23,6 +23,7 @@ namespace Swift {
QtTabbable* getCurrentTab();
signals:
void geometryChanged();
+ void onTitleChanged(const QString& title);
protected slots:
void closeEvent(QCloseEvent* event);
diff --git a/Swift/QtUI/QtChatWindowFactory.cpp b/Swift/QtUI/QtChatWindowFactory.cpp
index 5f91ff8..bc5d7f4 100644
--- a/Swift/QtUI/QtChatWindowFactory.cpp
+++ b/Swift/QtUI/QtChatWindowFactory.cpp
@@ -4,23 +4,24 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#include "QtChatWindowFactory.h"
+#include <Swift/QtUI/QtChatWindowFactory.h>
#include <QDesktopWidget>
-
-#include "QtChatTabs.h"
-#include "QtChatWindow.h"
-#include "QtSwiftUtil.h"
-#include "QtChatTheme.h"
#include <qdebug.h>
+#include <Swift/QtUI/QtChatTabs.h>
+#include <Swift/QtUI/QtChatWindow.h>
+#include <Swift/QtUI/QtSwiftUtil.h>
+#include <Swift/QtUI/QtChatTheme.h>
+#include <Swift/QtUI/QtSingleWindow.h>
+
namespace Swift {
static const QString SPLITTER_STATE = "mucSplitterState";
static const QString CHAT_TABS_GEOMETRY = "chatTabsGeometry";
-QtChatWindowFactory::QtChatWindowFactory(QSplitter* splitter, SettingsProvider* settings, QtSettingsProvider* qtSettings, QtChatTabs* tabs, const QString& themePath, QMap<QString, QString> emoticons) : themePath_(themePath), emoticons_(emoticons) {
+QtChatWindowFactory::QtChatWindowFactory(QtSingleWindow* splitter, SettingsProvider* settings, QtSettingsProvider* qtSettings, QtChatTabs* tabs, const QString& themePath, QMap<QString, QString> emoticons) : themePath_(themePath), emoticons_(emoticons) {
qtOnlySettings_ = qtSettings;
settings_ = settings;
tabs_ = tabs;
diff --git a/Swift/QtUI/QtChatWindowFactory.h b/Swift/QtUI/QtChatWindowFactory.h
index 4f59961..89a322f 100644
--- a/Swift/QtUI/QtChatWindowFactory.h
+++ b/Swift/QtUI/QtChatWindowFactory.h
@@ -6,21 +6,24 @@
#pragma once
-#include "Swift/Controllers/UIInterfaces/ChatWindowFactory.h"
-#include "Swiften/JID/JID.h"
-#include "QtSettingsProvider.h"
+#include <Swift/Controllers/UIInterfaces/ChatWindowFactory.h>
#include <QObject>
#include <QSplitter>
+
+#include <Swiften/JID/JID.h>
+#include <Swift/QtUI/QtSettingsProvider.h>
+
namespace Swift {
class QtChatTabs;
class QtChatTheme;
class UIEventStream;
class QtUIPreferences;
+ class QtSingleWindow;
class QtChatWindowFactory : public QObject, public ChatWindowFactory {
Q_OBJECT
public:
- QtChatWindowFactory(QSplitter* splitter, SettingsProvider* settings, QtSettingsProvider* qtSettings, QtChatTabs* tabs, const QString& themePath, QMap<QString, QString> emoticons);
+ QtChatWindowFactory(QtSingleWindow* splitter, SettingsProvider* settings, QtSettingsProvider* qtSettings, QtChatTabs* tabs, const QString& themePath, QMap<QString, QString> emoticons);
~QtChatWindowFactory();
ChatWindow* createChatWindow(const JID &contact, UIEventStream* eventStream);
signals:
diff --git a/Swift/QtUI/QtSingleWindow.cpp b/Swift/QtUI/QtSingleWindow.cpp
index 733571f..c970296 100644
--- a/Swift/QtUI/QtSingleWindow.cpp
+++ b/Swift/QtUI/QtSingleWindow.cpp
@@ -6,8 +6,10 @@
#include <Swift/QtUI/QtSingleWindow.h>
-#include <Swift/QtUI/QtSettingsProvider.h>
+
#include <Swiften/Base/foreach.h>
+#include <Swift/QtUI/QtSettingsProvider.h>
+#include <Swift/QtUI/QtChatTabs.h>
namespace Swift {
@@ -28,6 +30,18 @@ QtSingleWindow::~QtSingleWindow() {
}
+void QtSingleWindow::addWidget(QWidget* widget) {
+ QtChatTabs* tabs = dynamic_cast<QtChatTabs*>(widget);
+ if (tabs) {
+ connect(tabs, SIGNAL(onTitleChanged(const QString&)), this, SLOT(handleTabsTitleChanged(const QString&)));
+ }
+ QSplitter::addWidget(widget);
+}
+
+void QtSingleWindow::handleTabsTitleChanged(const QString& title) {
+ setWindowTitle(title);
+}
+
void QtSingleWindow::handleSplitterMoved(int, int) {
QList<QVariant> variantValues;
QList<int> intValues = sizes();
diff --git a/Swift/QtUI/QtSingleWindow.h b/Swift/QtUI/QtSingleWindow.h
index 6cbc3e4..b55b3c9 100644
--- a/Swift/QtUI/QtSingleWindow.h
+++ b/Swift/QtUI/QtSingleWindow.h
@@ -17,11 +17,13 @@ namespace Swift {
QtSingleWindow(QtSettingsProvider* settings);
virtual ~QtSingleWindow();
void insertAtFront(QWidget* widget);
+ void addWidget(QWidget* widget);
protected:
void resizeEvent(QResizeEvent*);
void moveEvent(QMoveEvent*);
private slots:
void handleSplitterMoved(int, int);
+ void handleTabsTitleChanged(const QString& title);
private:
void handleGeometryChanged();
void restoreSplitters();