• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

akonadi/clients

connectionpage.cpp

Go to the documentation of this file.
00001 /*
00002     This file is part of Akonadi.
00003 
00004     Copyright (c) 2006 Tobias Koenig <tokoe@kde.org>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
00019     USA.
00020 */
00021 
00022 #include "connectionpage.h"
00023 
00024 #include <QtGui/QTextEdit>
00025 #include <QtGui/QVBoxLayout>
00026 
00027 #include "tracernotificationinterface.h"
00028 
00029 ConnectionPage::ConnectionPage( const QString &identifier, QWidget *parent )
00030   : QWidget( parent ), mIdentifier( identifier ), mShowAllConnections( false )
00031 {
00032   QVBoxLayout *layout = new QVBoxLayout( this );
00033 
00034   mDataView = new QTextEdit( this );
00035   mDataView->setReadOnly( true );
00036 
00037   layout->addWidget( mDataView );
00038 
00039   org::freedesktop::Akonadi::TracerNotification *iface = new org::freedesktop::Akonadi::TracerNotification( QString(), "/tracing/notifications", QDBusConnection::sessionBus(), this );
00040 
00041   connect( iface, SIGNAL( connectionDataInput( const QString&, const QString& ) ),
00042            this, SLOT( connectionDataInput( const QString&, const QString& ) ) );
00043   connect( iface, SIGNAL( connectionDataOutput( const QString&, const QString& ) ),
00044            this, SLOT( connectionDataOutput( const QString&, const QString& ) ) );
00045 }
00046 
00047 void ConnectionPage::connectionDataInput( const QString &identifier, const QString &msg )
00048 {
00049   QString str;
00050   if ( mShowAllConnections ) {
00051     str += identifier + ' ';
00052   }
00053   if ( mShowAllConnections || identifier == mIdentifier ) {
00054     str += QString( "<font color=\"red\">%1</font>" ).arg( Qt::escape( msg ) );
00055     mDataView->append( str );
00056   }
00057 }
00058 
00059 void ConnectionPage::connectionDataOutput( const QString &identifier, const QString &msg )
00060 {
00061   QString str;
00062   if ( mShowAllConnections ) {
00063     str += identifier + ' ';
00064   }
00065   if ( mShowAllConnections || identifier == mIdentifier ) {
00066     str += QString( "<font color=\"blue\">%1</font>" ).arg( Qt::escape( msg ) );
00067     mDataView->append( str );
00068   }
00069 }
00070 
00071 void ConnectionPage::showAllConnections( bool show )
00072 {
00073   mShowAllConnections = show;
00074 }
00075 
00076 void ConnectionPage::clear()
00077 {
00078   mDataView->clear();
00079 }
00080 
00081 #include "connectionpage.moc"

akonadi/clients

Skip menu "akonadi/clients"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal