Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
commit 7e3446db409877f7d6c478dbc1b48e735796f702 2 parents 5d30a11 + 11762c1
@degtep degtep authored
View
10 plugins/meegointegration/meegoapplicationwindow/declarative/meego/ChatChannelList.qml
@@ -42,8 +42,8 @@ Page {
subtitle: channel.unit.id
iconSource: __suggestIcon(channel.unit, channel.unreadCount)
onClicked: {
- channel.active = true
- channel.showChat()
+ chat.activeSession = channel;
+ channel.showChat();
}
function __suggestIcon(unit, unreadCount) {
var iconId = "icon-m-";
@@ -66,7 +66,11 @@ Page {
id: closeButton
anchors { verticalCenter: parent.verticalCenter; right: parent.right }
platformIconId: "toolbar-close"
- onClicked: channel.destroy()
+ onClicked: {
+ if (unit.conference)
+ unit.leave();
+ channel.close()
+ }
}
}
}
View
5 plugins/meegointegration/meegoapplicationwindow/declarative/meego/ChatUnitsList.qml
@@ -42,8 +42,9 @@ Page {
model: unitsModel
delegate: ContactItem {
onClicked: {
- root.chat.session(model.contact).active = true
- root.chat.show()
+ var session = root.chat.session(model.contact);
+ chat.activeSession = session;
+ root.chat.show();
}
}
section.property: "alphabet"
View
5 plugins/meegointegration/meegoapplicationwindow/declarative/meego/ContactList.qml
@@ -56,8 +56,9 @@ Page {
model: listModel
delegate: ContactItem {
onClicked: {
- root.chat.session(model.contact).active = true
- root.chat.show()
+ var session = root.chat.session(model.contact);
+ chat.activeSession = session;
+ root.chat.show();
}
}
View
22 plugins/meegointegration/meegoapplicationwindow/declarative/meego/Main.qml
@@ -96,7 +96,16 @@ PageStackWindow {
Notifications {
id:notifications
windowActive: platformWindow.active
- onWindowActiveChanged: root.vibration.windowActive = windowActive
+ onWindowActiveChanged: {
+ root.vibration.windowActive = windowActive
+ var session = root.chat.activeSession;
+ if (session !== undefined && session !== null && tabGroup.currentTab === chatTab) {
+ if (windowActive)
+ session.active = true;
+ else
+ session.active = false;
+ }
+ }
}
initialPage: Page {
@@ -125,6 +134,17 @@ PageStackWindow {
id: conferenceUsersTab
chat: root.chat
}
+
+ onCurrentTabChanged: {
+ var session = root.chat.activeSession;
+ if (session !== undefined && session !== null) {
+ if (currentTab !== chatTab) {
+ session.active = false;
+ } else {
+ session.active = true;
+ }
+ }
+ }
}
tools: ToolBarLayout {
ButtonRow {
View
2  plugins/meegointegration/meegoapplicationwindow/declarative/meego/settings/ChatPage.qml
@@ -18,7 +18,7 @@ SettingsItemPage {
configPrefix += styleBox.currentItem.name + "/";
config.setValue(configPrefix + "variant", style.activeVariant);
config.setValue(configPrefix + "fontFamily", controller.fontFamily);
- config.setValue(configPrefix + "fontSize", controller.fontSize);
+ config.setValue(configPrefix + "fontSize", fontSizeField.value);
}
function load() {
var style = root.style;
View
36 plugins/meegointegration/meegoapplicationwindow/src/chat.cpp
@@ -68,6 +68,8 @@ qutim_sdk_0_3::ChatSession *Chat::getSession(qutim_sdk_0_3::ChatUnit *unit, bool
ChatChannel *channel = 0;
if (create) {
channel = new ChatChannel(unit);
+ QDeclarativeEngine::setObjectOwnership(channel, QDeclarativeEngine::CppOwnership);
+ QDeclarativeEngine::setObjectOwnership(unit, QDeclarativeEngine::CppOwnership);
connect(channel, SIGNAL(activated(bool)), SLOT(onSessionActivated(bool)));
connect(channel, SIGNAL(destroyed(QObject*)), SLOT(onSessionDestroyed(QObject*)));
m_channels << channel;
@@ -100,7 +102,12 @@ qutim_sdk_0_3::ChatSession *Chat::activeSession() const
void Chat::setActiveSession(qutim_sdk_0_3::ChatSession *session)
{
- session->setActive(true);
+ if (session != m_activeSession) {
+ m_activeSession = session;
+ emit activeSessionChanged(session);
+ if (session)
+ session->setActive(true);
+ }
}
void Chat::show()
@@ -110,19 +117,20 @@ void Chat::show()
void Chat::onSessionActivated(bool active)
{
- ChatSession *session = static_cast<ChatSession*>(sender());
- if (active && m_activeSession != session) {
- if (m_activeSession) {
- blockSignals(true);
- m_activeSession->setActive(false);
- blockSignals(false);
- }
- m_activeSession = session;
- emit activeSessionChanged(m_activeSession);
- } else if (m_activeSession == session && !active) {
- m_activeSession = NULL;
- emit activeSessionChanged(m_activeSession);
- }
+ Q_UNUSED(active);
+// ChatSession *session = static_cast<ChatSession*>(sender());
+// if (active && m_activeSession != session) {
+// if (m_activeSession) {
+// blockSignals(true);
+// m_activeSession->setActive(false);
+// blockSignals(false);
+// }
+// m_activeSession = session;
+// emit activeSessionChanged(m_activeSession);
+// } else if (m_activeSession == session && !active) {
+// m_activeSession = NULL;
+// emit activeSessionChanged(m_activeSession);
+// }
}
void Chat::onSessionDestroyed(QObject *object)
View
8 plugins/meegointegration/meegoapplicationwindow/src/chatchannel.cpp
@@ -54,6 +54,9 @@ ChatChannel::ChatChannel(qutim_sdk_0_3::ChatUnit *unit)
ChatChannel::~ChatChannel()
{
setActive(false);
+ Chat *chat = static_cast<Chat*>(Chat::instance());
+ if (chat && chat->activeSession() == this)
+ chat->setActiveSession(0);
}
qutim_sdk_0_3::ChatUnit *ChatChannel::getUnit() const
@@ -128,6 +131,11 @@ void ChatChannel::showChat()
static_cast<Chat*>(Chat::instance())->show();
}
+void ChatChannel::close()
+{
+ deleteLater();
+}
+
QObject *ChatChannel::units() const
{
return m_units;
View
1  plugins/meegointegration/meegoapplicationwindow/src/chatchannel.h
@@ -58,6 +58,7 @@ class ChatChannel : public qutim_sdk_0_3::ChatSession
QObject *model() const;
Q_INVOKABLE qint64 send(const QString &text);
Q_INVOKABLE void showChat();
+ Q_INVOKABLE void close();
QObject *units() const;
QObject *page() const;
void setPage(QObject *page);
View
10 plugins/meegointegration/meegoapplicationwindow/src/quicksettingsmodel.cpp
@@ -45,6 +45,15 @@ bool itemLessThen(SettingsItem *a, SettingsItem *b)
return a->text().toString() < b->text().toString();
}
+static void filterItems(qutim_sdk_0_3::SettingsItemList &items)
+{
+ for (int i = items.size() - 1; i >= 0; --i) {
+ const QByteArray name = items.at(i)->text().original();
+ if (name == "Icq")
+ items.removeAt(i);
+ }
+}
+
void QuickSettingsModel::setItems(const qutim_sdk_0_3::SettingsItemList &items, QObject *controller)
{
m_controller = controller;
@@ -55,6 +64,7 @@ void QuickSettingsModel::setItems(const qutim_sdk_0_3::SettingsItemList &items,
}
beginInsertRows(QModelIndex(), 0, items.size());
m_items = items;
+ filterItems(m_items);
qSort(m_items.begin(), m_items.end(), itemLessThen);
endInsertRows();
}
2  translations
@@ -1 +1 @@
-Subproject commit c8d615596ce1f4dc7f9e13cdd7e584de62616524
+Subproject commit d5c42c60a3714569f6656ff7d2c448654cd9227d
Please sign in to comment.
Something went wrong with that request. Please try again.