~ubuntu-branches/ubuntu/lucid/konversation/lucid-updates

« back to all changes in this revision

Viewing changes to src/notificationhandler.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Modestas Vainius
  • Date: 2009-05-15 11:24:24 UTC
  • mfrom: (1.15.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 47.
  • Revision ID: james.westby@ubuntu.com-20090515112424-b74i26lciabf4qnk
Tags: 1.1.75+svn968012-1
* New upstream development snapshot:
  - Last Changed Author: hein
  - Last Changed Rev: 968012
  - Last Changed Date: 2009-05-14 21:03:55 +0300
* Update README.source.
* Use dh --quilt instead of custom patch handling, build depend on
  quilt 0.46-7~.
* Update patches to upstream changes.
* Update konversation.install: remove docs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
200
200
        KNotification::event(QString::fromLatin1("dcc_incoming"), i18n("%1 wants to send a file to you",fromNick), QPixmap(), m_mainWindow);
201
201
    }
202
202
 
 
203
    void NotificationHandler::dccError(ChatWindow* chatWin, const QString& error)
 
204
    {
 
205
        if (!chatWin || !chatWin->notificationsEnabled())
 
206
            return;
 
207
 
 
208
        if (Preferences::self()->disableNotifyWhileAway() && chatWin->getServer() && chatWin->getServer()->isAway())
 
209
            return;
 
210
 
 
211
        KNotification::event(QString::fromLatin1("dcc_error"), i18n("An Error has occurred in a DCC transfer: %1",error), QPixmap(), m_mainWindow);
 
212
    }
 
213
 
 
214
    void NotificationHandler::dccTransferDone(ChatWindow* chatWin, const QString& file)
 
215
    {
 
216
        if (!chatWin || !chatWin->notificationsEnabled())
 
217
            return;
 
218
 
 
219
        if (Preferences::self()->disableNotifyWhileAway() && chatWin->getServer() && chatWin->getServer()->isAway())
 
220
            return;
 
221
 
 
222
        KNotification::event(QString::fromLatin1("dcctransfer_done"), i18n("%1 File Transfer is complete",file), QPixmap(), m_mainWindow);
 
223
    }
 
224
 
203
225
    void NotificationHandler::mode(ChatWindow* chatWin, const QString& /*nick*/)
204
226
    {
205
227
        if (!chatWin || !chatWin->notificationsEnabled())
292
314
            return;
293
315
 
294
316
        startTrayNotification(chatWin);
 
317
        
 
318
        QString cleanedMessage = Qt::escape(Konversation::removeIrcMarkup(message));
 
319
        QString cutup = addLineBreaks(cleanedMessage);
 
320
        
 
321
        if(fromNick.isEmpty())
 
322
            KNotification::event(QString::fromLatin1("highlight"), QString("<qt>(%1) *** %2</qt>").arg(chatWin->getName()).arg(cutup), QPixmap(), m_mainWindow);
 
323
        else
 
324
            KNotification::event(QString::fromLatin1("highlight"), QString("<qt>(%1) &lt;%2&gt; %3</qt>").arg(chatWin->getName()).arg(fromNick).arg(cutup), QPixmap(), m_mainWindow);
 
325
        
295
326
        if(Preferences::self()->oSDShowOwnNick() &&
296
327
            (!m_mainWindow->isActiveWindow() || (chatWin != m_mainWindow->getViewContainer()->getFrontView())))
297
328
        {