[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdenetwork/kopete/protocols/wlm
From: Tiago Salem Herrmann <tiagosh () gmail ! com>
Date: 2009-07-05 17:29:28
Message-ID: 1246814968.677930.19183.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 991796 by salem:
- add a new general tab to the account preferences and new options to better control \
the emoticons behavior
M +45 -2 ui/wlmaccountpreferences.ui
M +8 -0 ui/wlmeditaccountwidget.cpp
M +9 -0 wlmaccount.cpp
M +2 -0 wlmaccount.h
M +3 -0 wlmchatmanager.cpp
M +20 -13 wlmchatsession.cpp
--- trunk/KDE/kdenetwork/kopete/protocols/wlm/ui/wlmaccountpreferences.ui \
#991795:991796 @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>684</width>
+ <width>671</width>
<height>412</height>
</rect>
</property>
@@ -20,7 +20,7 @@
<item>
<widget class="QTabWidget" name="mainTabWidget">
<property name="currentIndex">
- <number>2</number>
+ <number>3</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@@ -542,6 +542,49 @@
</item>
</layout>
</widget>
+ <widget class="QWidget" name="tab_4">
+ <attribute name="title">
+ <string>General</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_8">
+ <item>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
+ <string>General Options</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_7">
+ <item>
+ <widget class="QCheckBox" name="m_doNotSendEmoticons">
+ <property name="text">
+ <string>Do not send custom emoticons to other contacts</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="m_doNotRequestEmoticons">
+ <property name="text">
+ <string>Do not show custom emoticons from other contacts</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
</widget>
</item>
<item>
--- trunk/KDE/kdenetwork/kopete/protocols/wlm/ui/wlmeditaccountwidget.cpp \
#991795:991796 @@ -64,6 +64,9 @@
m_preferencesWidget->m_proxyUsername->setText( m_wlmAccount->proxyUsername() \
);
m_preferencesWidget->m_proxyPassword->setText( m_wlmAccount->proxyPassword() \
);
+ m_preferencesWidget->m_doNotSendEmoticons->setChecked( \
m_wlmAccount->doNotSendEmoticons() ); + \
m_preferencesWidget->m_doNotRequestEmoticons->setChecked( \
m_wlmAccount->doNotRequestEmoticons() ); +
if(m_wlmAccount->proxyType() == QNetworkProxy::Socks5Proxy )
m_preferencesWidget->m_radioProxySocks5->setChecked( true );
else
@@ -165,7 +168,12 @@
config->writeEntry( "enableProxy", false );
}
+ config->writeEntry( "doNotSendEmoticons",
+ m_preferencesWidget->m_doNotSendEmoticons->isChecked());
+ config->writeEntry( "doNotRequestEmoticons",
+ m_preferencesWidget->m_doNotRequestEmoticons->isChecked());
+
if ( wlmAccount->isConnected() )
{
QSet<QString> allowList = wlmAccount->allowList();
--- trunk/KDE/kdenetwork/kopete/protocols/wlm/wlmaccount.cpp #991795:991796
@@ -364,7 +364,16 @@
return configGroup()->readEntry( "enableProxy", false );
}
+bool WlmAccount::doNotRequestEmoticons() const
+{
+ return configGroup()->readEntry( "doNotRequestEmoticons", false );
+}
+bool WlmAccount::doNotSendEmoticons() const
+{
+ return configGroup()->readEntry( "doNotSendEmoticons", false );
+}
+
void
WlmAccount::gotNewContact (const MSN::ContactList & list,
const QString & passport,
--- trunk/KDE/kdenetwork/kopete/protocols/wlm/wlmaccount.h #991795:991796
@@ -101,6 +101,8 @@
QString proxyUsername() const;
QString proxyPassword() const;
uint proxyType() const;
+ bool doNotRequestEmoticons() const;
+ bool doNotSendEmoticons() const;
WlmServer * server ();
--- trunk/KDE/kdenetwork/kopete/protocols/wlm/wlmchatmanager.cpp #991795:991796
@@ -559,6 +559,9 @@
{
Q_UNUSED( buddy );
+ if(m_account->doNotRequestEmoticons())
+ return;
+
WlmChatSession *chat = chatSessions[conn];
if(!chat)
return;
--- trunk/KDE/kdenetwork/kopete/protocols/wlm/wlmchatsession.cpp #991795:991796
@@ -565,20 +565,27 @@
mmsg.setColor(color.red(), color.green(), color.blue());
}
- // stolen from msn plugin
- const QHash<QString, QStringList> emap = \
Kopete::Emoticons::self()->theme().emoticonsMap(); + WlmAccount *acc = \
qobject_cast < WlmAccount * >(account ()); + if(!acc)
+ return mmsg;
- // Check the list for any custom emoticons
- for (QHash<QString, QStringList>::const_iterator itr = emap.begin(); itr != \
emap.end(); ++itr)
- {
- for (QStringList::const_iterator itr2 = itr.value().constBegin(); itr2 != \
itr.value().constEnd(); ++itr2)
- {
- if (msg.plainBody().contains(*itr2))
- {
- getChatService()->sendEmoticon((*itr2).toAscii().data(), \
itr.key().toAscii().data());
- }
- }
- }
+ if(!acc->doNotSendEmoticons())
+ {
+ // stolen from msn plugin
+ const QHash<QString, QStringList> emap = \
Kopete::Emoticons::self()->theme().emoticonsMap(); +
+ // Check the list for any custom emoticons
+ for (QHash<QString, QStringList>::const_iterator itr = emap.begin(); itr != \
emap.end(); ++itr) + {
+ for (QStringList::const_iterator itr2 = itr.value().constBegin(); itr2 \
!= itr.value().constEnd(); ++itr2) + {
+ if (msg.plainBody().contains(*itr2))
+ {
+ getChatService()->sendEmoticon((*itr2).toAscii().data(), \
itr.key().toAscii().data()); + }
+ }
+ }
+ }
return mmsg;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic