On Wednesday 23 April 2008 01:01:20 Olivier Goffart wrote: > Le mercredi 23 avril 2008, Detlev Casanova a écrit : > > On Tuesday 22 April 2008 23:53:42 Olivier Goffart wrote: > > > Le mardi 22 avril 2008, Detlev Casanova a écrit : > > > > Hi there, > > > > I found annoying the fact that every time you receive a message, > > > > kopete shows a popup asking if you want to see it or ignore it even > > > > if the chat window is already opened and already has focus. > > > > > > Right > > > > > > > I wrote this little patch which shows the popup only when the window > > > > is not already opened. > > > > > > But i still want the popup when the window is open but has not the > > > focus. (so i click the popup to see the message) > > > > Well, each one has its preferences, I don't find it very usable. > > That should be configurable then. > > You want to have notifications of all messages or only 1 notifications > > for all messages that comes while the window has no focus ? > > > > > > That patch is made for the svn trunk revision 799857 of kdenetwork. > > > > It modifies kopete/kopete/kopete.notifyrc to have a new Event > > > > (kopete_popup_contact_incoming) which shows a popup while the old one > > > > (kopete_contact_incoming) doesn't anymore and > > > > kopete/libkopete/private/kopeteviewmanager.cpp to use the right > > > > notify Event. > > > > > > Why do you remove the text and the contextes and the action in that > > > case for the different notification? > > > > For the text and the actions, as the popup won't be shown, it's not > > usefull, for contextes, it's my mistake :) > > The text may be logged to a file. And the popup may still apears if the > user configure it.
Here's the corrected patch, text, actions and contextes are now left behind. -- Detlev Casanova Student at the Université de Liège (computer science) Open source project : Kapture ( http://kapture.berlios.de/ )
Index: kopete/kopete/kopete.notifyrc
===================================================================
--- kopete/kopete/kopete.notifyrc (revision 800342)
+++ kopete/kopete/kopete.notifyrc (working copy)
@@ -334,6 +334,95 @@
Comment[zh_TW]=ن�ن�م�هو�ن�
Contexts=contact,group,class
Sound=KDE-Im-Message-In.ogg
+Action=Sound|Taskbar
+Persistant=true
+
+[Event/kopete_popup_contact_incoming]
+Name=Incoming Message With Popup
+Name[ca]=Missatge entrant
+Name[cs]=Pإأchozأ zprأ�va
+Name[da]=Indkommende besked
+Name[de]=Eingehende Nachricht
+Name[el]=خخ�دخ�دددخ�خ�خ�خ؟ خ�خ�خ�د
خ�خ�
+Name[eo]=Alvenanta mesaؤo
+Name[es]=Mensaje entrante
+Name[et]=Sisenev sأ�num
+Name[fi]=Saapuvat viestit
+Name[fr]=Message entrant
+Name[ga]=Teachtaireacht Isteach
+Name[gl]=Mensaxe entrante
+Name[hi]=ـ¤ـ¤�ـ¤ ـ¤�ـ¤ـ¤�ـ�ـ¤�
+Name[it]=Messaggio in arrivo
+Name[ja]=مل؟�ك�كك؛ك�ك�
+Name[km]=فف�فقففقففف
+Name[ko]=ً�ٌٌ� ٌٌ
+Name[lt]=Gauta إ�inutؤ
+Name[lv]=Ienؤkusi ziإa
+Name[nb]=Innkommende melding
+Name[nds]=Ankamen Naricht
+Name[nl]=Inkomend bericht
+Name[pa]=ـ� ـ��ـ�؟ـ��ـ�� ـ��ـ�ـ��ـ�ـ��ـ��
+Name[pl]=Wiadomoإؤ przychodzؤ
ca
+Name[pt]=Mensagem Recebida
+Name[pt_BR]=Mensagem Recebida
+Name[ru]=ذر
ذ�ذ�ررذ�ذ� رذ�ذ�ذ�رذ�ذ�ذ�ذ�
+Name[sl]=Prihajajoؤe sporoؤilo
+Name[sv]=Inkommande meddelande
+Name[tr]=Gelen ؤ�letiler
+Name[uk]=ذر
رذ�ذ�ذ� ذ؟ذ�ذ�رذ�ذ�ذ�ذ؛ذ�ذ�ذ�ر
+Name[x-test]=xxIncoming Messagexx
+Name[zh_CN]=ن�م�هن�ن�
+Name[zh_TW]=ى�ل�هو�ن�
+Comment=An incoming message has been received and a popup has to be shown
+Comment[bn]=ـ�ـ�ـ�ـ�؟ ـ�
ـ��ـ�ـ�¤ـ��ـ�ـ��ـ�ـ�ـ� ـ�،ـ��ـ��ـ�ـ�¤ـ�� ـ�ـ�ـ��ـ��ـ�� ـ�ـ��ـ�� ـ��ـ�ـ�ـ�ـ�
+Comment[ca]=S'ha rebut un missatge entrant
+Comment[cs]=Byla obdrإ�ena pإأchozأ zprأ�va
+Comment[da]=En indkommende besked er blevet modtaget
+Comment[de]=Eine eingehende Nachricht wurde empfangen
+Comment[el]=خدخ�خ� خ؛خ�دخ�خ�خ� خخ�خ� خ�خ�دخ�دددخ�خ�خ�خ؟ خ�خ�خ�د
خ�خ�
+Comment[eo]=Alvenanta mesaؤo estis ricevita
+Comment[es]=Se ha recibido un mensaje entrante
+Comment[et]=Saabus sأ�num
+Comment[eu]=Sarrerako mezu bat jaso da
+Comment[fi]=Viesti on saapunut
+Comment[fr]=Un message entrant a أ�tأ� reأ�u
+Comment[ga]=Fuarthas teachtaireacht isteach
+Comment[gl]=Recebeuse unha mensaxe entrante
+Comment[he]=طط�ط�طط طط�ط� ط طط ط�
+Comment[hi]=ـ¤ـ¤ ـ¤ـ¤�ـ¤ ـ¤�ـ¤ـ¤�ـ�ـ¤� ـ¤�ـ�ـ¤�ـ¤�ـ¤�ـ�ـ¤¤ ـ¤�ـ�ـ¤
+Comment[hr]=Primljena je dolazna poruka
+Comment[hu]=Bejأ�vإ أ�zenet أ�rkezett
+Comment[is]=Skeyti mأ�ttekiأ�
+Comment[it]=أ stato ricevuto un nuovo messaggio
+Comment[ja]=مل؟�ك�كك؛ك�ك�كم�كك�كك
+Comment[km]=فف�فقففف�فقفففف؛فففقفف�فقف
ف�ف
+Comment[ko]=ً¤ٌ�ٌ¤ً ً�ٌٌ�ً�� ً�ٌ
+Comment[lt]=Gauta nauja إ�inutؤ
+Comment[lv]=Ir saإemta ienؤkoإ�ؤ ziإa
+Comment[mk]=ذرذ�ذ�ذ�ذ�ذ� ذ� ذ�ذ�رذ�ذ�ذ�ذ�ذ� ذ؟ذ�رذ�ذ�ذ�
+Comment[nb]=En innkommende melding er mottatt
+Comment[nds]=En Naricht keem rin
+Comment[nl]=Er is een inkomend bericht ontvangen
+Comment[pl]=Nadeszإa nowa wiadomoإؤ
+Comment[pt]=Foi recebida uma mensagem
+Comment[pt_BR]=chegou nova mensagem
+Comment[ru]=ذذ�ذ؛ررذ�ذ�ذ� ذ�ذ�ذ�ذ�ذ� رذ�ذ�ذ�رذ�ذ�ذ�ذ�
+Comment[sk]=Prأchod sprأ�vy
+Comment[sl]=Prejeto je bilo prihajajoؤe sporoؤilo
+Comment[sr]=Primljena je dolazeؤa poruka
[EMAIL PROTECTED] je dolazeؤa poruka
+Comment[sv]=Ett inkommande meddelande har anlأ¤nt
+Comment[ta]=ـ�ـ��ـ�ـ��ـ��ـ�ـ��ـ� ـ�¤ـ�ـ��ـ��ـ� ـ��ـ�ـ��ـ��ـ�ـ��ـ�ـ�ـ�ـ�¤ـ�
+Comment[tg]=ذذ�ذ�رذ�ذ� ذ�ذ�رذ�ذ�رذ�ذ�ذ�ذ�ذ�ذ� زذ�ذ�رذ؛ ذ�ذ�رذ�ذ�ذ�
+Comment[tr]=Bir gelen mesaj alؤ�ndؤ�
+Comment[uk]=ذررذ�ذ�ذ�ذ�ذ� ذ�ر
رذ�ذ�ذ� ذ؟ذ�ذ�رذ�ذ�ذ�ذ؛ذ�ذ�ذ�ر
+Comment[uz]=ذ�ذ�ذ�ذ�ر زذ�ذ�رذ؛ زذ�ذ؛ذ�ذ�ذ�ذ�
+Comment[x-test]=xxAn incoming message has been receivedxx
+Comment[zh_CN]=ن�م�ل�ل�ن�ن�ن�
+Comment[zh_HK]=ن�م�ن�و�ن�
+Comment[zh_TW]=ن�ن�م�هو�ن�
+Contexts=contact,group,class
+Sound=KDE-Im-Message-In.ogg
Action=Sound|Popup|Taskbar
Persistant=true
Index: kopete/kopete/config/behavior/behaviorconfig_events.ui
===================================================================
--- kopete/kopete/config/behavior/behaviorconfig_events.ui (revision 800342)
+++ kopete/kopete/config/behavior/behaviorconfig_events.ui (working copy)
@@ -6,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>371</width>
- <height>393</height>
+ <height>423</height>
</rect>
</property>
<property name="windowTitle" >
@@ -16,39 +16,15 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
+ <property name="margin" >
<number>9</number>
</property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
- <number>9</number>
- </property>
<item>
<widget class="QGroupBox" name="notifyGroupBox" >
<property name="title" >
<string>Tray Flash && Bubble</string>
</property>
- <layout class="QVBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
- <number>9</number>
- </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QCheckBox" name="kcfg_trayflashNotify" >
<property name="toolTip" >
@@ -67,18 +43,9 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
+ <property name="margin" >
<number>0</number>
</property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
<item>
<spacer>
<property name="orientation" >
@@ -87,7 +54,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>16</width>
<height>16</height>
@@ -127,22 +94,49 @@
</widget>
</item>
<item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <property name="sizeConstraint" >
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="kcfg_balloonNotifyWhenChatWindowIsOpen" >
+ <property name="windowModality" >
+ <enum>Qt::NonModal</enum>
+ </property>
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Show bubble even if chat window is open</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
+ <property name="margin" >
<number>0</number>
</property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
<item>
<widget class="QCheckBox" name="kcfg_balloonNotifyIgnoreClosesChatView" >
<property name="toolTip" >
@@ -196,18 +190,9 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
+ <property name="margin" >
<number>9</number>
</property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
- <number>9</number>
- </property>
<item>
<widget class="QCheckBox" name="kcfg_enableEventsWhileAway" >
<property name="toolTip" >
@@ -271,7 +256,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>16</height>
@@ -313,5 +298,21 @@
</hint>
</hints>
</connection>
+ <connection>
+ <sender>kcfg_balloonNotify</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>kcfg_balloonNotifyWhenChatWindowIsOpen</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>185</x>
+ <y>108</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>195</x>
+ <y>136</y>
+ </hint>
+ </hints>
+ </connection>
</connections>
</ui>
Index: kopete/libkopete/private/kopeteviewmanager.cpp
===================================================================
--- kopete/libkopete/private/kopeteviewmanager.cpp (revision 800342)
+++ kopete/libkopete/private/kopeteviewmanager.cpp (working copy)
@@ -262,6 +262,7 @@
QWidget *viewWidget = 0L;
bool showNotification = false;
+ bool showPopup = true;
bool isActiveWindow = false;
if ( !outgoingMessage && ( !manager->account()->isAway() || Kopete::BehaviorSettings::self()->enableEventsWhileAway() )
@@ -271,12 +272,16 @@
isActiveWindow = manager->view(false) && viewWidget && manager->view() == d->activeView && viewWidget->isActiveWindow();
showNotification = ( (!isActiveWindow || Kopete::BehaviorSettings::self()->showEventsIfActive())
&& msg.from());
+
+ showPopup = !(viewWidget && viewWidget->isVisible()) || ((viewWidget && viewWidget->isVisible()) && Kopete::BehaviorSettings::self()->balloonNotifyWhenChatWindowIsOpen());
}
-
+
Kopete::MessageEvent *event = 0L;
if ( (appendMessageEvent && !outgoingMessage) || showNotification )
{
showNotification = showNotification || d->eventList.isEmpty(); // may happen for internal messages
+ if (showPopup && !d->eventList.isEmpty())
+ showPopup = false;
event = new Kopete::MessageEvent(msg,manager);
d->eventList.append( event );
connect(event, SIGNAL(done(Kopete::MessageEvent *)), this, SLOT(slotEventDeleted(Kopete::MessageEvent *)));
@@ -303,7 +308,10 @@
body = ki18n( "<qt>A highlighted message arrived from %1<br />\"%2\"</qt>" );
break;
default:
- eventId = QLatin1String( "kopete_contact_incoming" );
+ if (showPopup)
+ eventId = QLatin1String( "kopete_popup_contact_incoming" );
+ else
+ eventId = QLatin1String( "kopete_contact_incoming" );
}
KNotification *notify=new KNotification(eventId, viewWidget, isActiveWindow ? KNotification::CloseOnTimeout : KNotification::Persistent);
Index: kopete/libkopete/kopetebehaviorsettings.kcfg
===================================================================
--- kopete/libkopete/kopetebehaviorsettings.kcfg (revision 800342)
+++ kopete/libkopete/kopetebehaviorsettings.kcfg (working copy)
@@ -65,6 +65,10 @@
<label>Use Balloon notification.</label>
<default>true</default>
</entry>
+ <entry key="balloonNotifyWhenChatWindowIsOpen" type="Bool">
+ <label>Show Balloon notification even if the chat window is open</label>
+ <default>false</default>
+ </entry>
<entry key="balloonNotifyIgnoreClosesChatView" type="Bool">
<label>Balloon Notification Ignore Closes Chat View</label>
<default>false</default>
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ kopete-devel mailing list [email protected] https://mail.kde.org/mailman/listinfo/kopete-devel
