~ubuntu-branches/ubuntu/natty/knemo/natty

« back to all changes in this revision

Viewing changes to src/knemod/interfacetray.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-02-22 16:36:22 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20110222163622-d8i62gy1stn7tydv
Tags: 0.7.0-0ubuntu1
* New upstream release.
* Switch to source format 3.0 (quilt).
* Make knemo depend on libqt4-sql-sqlite.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* This file is part of KNemo
2
2
   Copyright (C) 2004, 2005 Percy Leonhardt <percy@eris23.de>
3
 
   Copyright (C) 2009 John Stamp <jstamp@users.sourceforge.net>
 
3
   Copyright (C) 2009, 2010 John Stamp <jstamp@users.sourceforge.net>
4
4
 
5
5
   KNemo is free software; you can redistribute it and/or modify
6
6
   it under the terms of the GNU Library General Public License as
70
70
{
71
71
    QString currentTip;
72
72
#ifdef HAVE_KSTATUSNOTIFIERITEM
73
 
    QString title = mInterface->getSettings().alias;
 
73
    QString title = mInterface->settings().alias;
74
74
    if ( title.isEmpty() )
75
 
        title = mInterface->getName();
 
75
        title = mInterface->ifaceName();
76
76
    title = i18n( "KNemo - %1", title );
77
77
    if ( toolTipTitle() != title )
78
78
        setToolTipTitle( title );
156
156
{
157
157
    QString tipData;
158
158
    int toolTipContent = generalSettings->toolTipContent;
159
 
    const BackendData * data = mInterface->getData();
 
159
    const BackendData * data = mInterface->backendData();
160
160
    if ( !data )
161
161
        return QString();
162
162
    QString leftTags = "<tr><td style='padding-right:1em; white-space:nowrap;'>";
166
166
    tipData = "<table cellspacing='2'>";
167
167
 
168
168
#ifndef HAVE_KSTATUSNOTIFIERITEM
169
 
    QString title = mInterface->getSettings().alias;
 
169
    QString title = mInterface->settings().alias;
170
170
    if ( title.isEmpty() )
171
 
        title = mInterface->getName();
 
171
        title = mInterface->ifaceName();
172
172
 
173
173
    if ( toolTipContent & ALIAS )
174
174
        tipData += "<tr><th colspan='2' style='text-align:center;'>" + title + "</th></tr>";
175
175
#endif
176
176
    if ( toolTipContent & INTERFACE )
177
 
        tipData += leftTags + i18n( "Interface" ) + centerTags + mInterface->getName() + rightTags;
 
177
        tipData += leftTags + i18n( "Interface" ) + centerTags + mInterface->ifaceName() + rightTags;
178
178
 
179
179
    if ( toolTipContent & STATUS )
180
180
    {
193
193
    if ( data->status & KNemoIface::Connected &&
194
194
         toolTipContent & UPTIME )
195
195
    {
196
 
            tipData += leftTags + i18n( "Connection time" ) + centerTags + mInterface->getUptimeString() + rightTags ;
 
196
            tipData += leftTags + i18n( "Connection time" ) + centerTags + mInterface->uptimeString() + rightTags ;
197
197
    }
198
198
 
199
199
    if ( data->status & KNemoIface::Up )
259
259
    if ( data->status & KNemoIface::Connected )
260
260
    {
261
261
        if ( toolTipContent & DOWNLOAD_SPEED )
262
 
            tipData += leftTags + i18n( "Download Speed" ) + centerTags + mInterface->getRxRateStr() + rightTags;
 
262
            tipData += leftTags + i18n( "Download Speed" ) + centerTags + mInterface->rxRateStr() + rightTags;
263
263
        if ( toolTipContent & UPLOAD_SPEED )
264
 
            tipData += leftTags + i18n( "Upload Speed" ) + centerTags + mInterface->getTxRateStr() + rightTags;
 
264
            tipData += leftTags + i18n( "Upload Speed" ) + centerTags + mInterface->txRateStr() + rightTags;
265
265
    }
266
266
 
267
267
    if ( data->status & KNemoIface::Connected && data->isWireless )
303
303
{
304
304
    // Cannot make this data static as the i18n macro doesn't seem
305
305
    // to work when called to early i.e. before setting the catalogue.
306
 
    mScope.insert( RT_SCOPE_NOWHERE, i18n( "none" ) );
307
 
    mScope.insert( RT_SCOPE_HOST, i18n( "host" ) );
308
 
    mScope.insert( RT_SCOPE_LINK, i18n( "link" ) );
309
 
    mScope.insert( RT_SCOPE_SITE, i18n( "site" ) );
310
 
    mScope.insert( RT_SCOPE_UNIVERSE, i18n( "global" ) );
 
306
    mScope.insert( RT_SCOPE_NOWHERE, i18nc( "ipv6 address scope", "none" ) );
 
307
    mScope.insert( RT_SCOPE_HOST, i18nc( "ipv6 address scope", "host" ) );
 
308
    mScope.insert( RT_SCOPE_LINK, i18nc( "ipv6 address scope", "link" ) );
 
309
    mScope.insert( RT_SCOPE_SITE, i18nc( "ipv6 address scope", "site" ) );
 
310
    mScope.insert( RT_SCOPE_UNIVERSE, i18nc( "ipv6 address scope", "global" ) );
311
311
}
312
312
 
313
313
#include "interfacetray.moc"