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 &amp;&amp; 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>

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to