~ubuntu-branches/ubuntu/precise/knemo/precise

« back to all changes in this revision

Viewing changes to src/knemod/interface.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2010-01-06 17:16:51 UTC
  • mfrom: (1.1.9 upstream) (2.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100106171651-ff58ryfnav4l1zbm
Tags: 0.6.0-1
* New upstream release 
  - Fixes "FTBFS: sysbackend.cpp:362: error: 'KILO' was not declared in
  this scope" (Closes: #560496)
  - Fixes "context menu does not appear" (Closes: #504791)
* Add Build-Depends: libnl-dev - Linux netlink sockets library

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
   Boston, MA 02110-1301, USA.
19
19
*/
20
20
 
21
 
#include <QTimer>
 
21
#include <math.h>
22
22
 
 
23
#include <KCalendarSystem>
 
24
#include <KColorScheme>
 
25
#include <KNotification>
23
26
#include <KWindowSystem>
 
27
#include <kio/global.h>
24
28
 
 
29
#include "backends/backendbase.h"
 
30
#include "utils.h"
25
31
#include "interface.h"
26
32
#include "interfaceplotterdialog.h"
27
33
#include "interfacestatistics.h"
28
34
#include "interfacestatusdialog.h"
29
35
#include "interfacestatisticsdialog.h"
30
36
 
31
 
Interface::Interface( QString ifname,
32
 
                      const GeneralData& generalData,
33
 
                      const PlotterSettings& plotterSettings )
 
37
Interface::Interface( const QString &ifname,
 
38
                      const BackendData* data,
 
39
                      const GeneralData& generalData )
34
40
    : QObject(),
35
 
      mType( UNKNOWN_TYPE ),
36
 
      mState( UNKNOWN_STATE ),
 
41
      mType( KNemoIface::UnknownType ),
 
42
      mState( KNemoIface::UnknownState ),
 
43
      mPreviousState( KNemoIface::UnknownState ),
37
44
      mName( ifname ),
38
 
      mPlotterTimer( 0 ),
 
45
      mRealSec( 0.0 ),
 
46
      mUptime( 0 ),
 
47
      mUptimeString( "00:00:00" ),
 
48
      mRxRate( 0 ),
 
49
      mTxRate( 0 ),
39
50
      mIcon( this ),
40
51
      mStatistics( 0 ),
41
52
      mStatusDialog( 0 ),
42
53
      mStatisticsDialog(  0 ),
43
54
      mPlotterDialog( 0 ),
44
 
      mGeneralData( generalData ),
45
 
      mPlotterSettings( plotterSettings )
 
55
      mBackendData( data ),
 
56
      mGeneralData( generalData )
46
57
{
47
 
    mPlotterDialog = new InterfacePlotterDialog( mPlotterSettings, mName );
48
 
    mPlotterTimer = new QTimer();
 
58
    mPlotterDialog = new InterfacePlotterDialog( mName );
49
59
 
50
 
    connect( mPlotterTimer, SIGNAL( timeout() ),
51
 
             this, SLOT( updatePlotter() ) );
52
 
    connect( &mMonitor, SIGNAL( statusChanged( int ) ),
53
 
             &mIcon, SLOT( updateStatus( int ) ) );
54
 
    connect( &mMonitor, SIGNAL( available( int ) ),
55
 
             &mIcon, SLOT( updateTrayStatus( int ) ) );
56
 
    connect( &mMonitor, SIGNAL( notAvailable( int ) ),
57
 
             &mIcon, SLOT( updateTrayStatus( int ) ) );
58
 
    connect( &mMonitor, SIGNAL( notExisting( int ) ),
59
 
             &mIcon, SLOT( updateTrayStatus( int ) ) );
60
 
    connect( &mMonitor, SIGNAL( updateDetails() ),
61
 
             this, SLOT( updateDetails() ) );
62
 
    connect( &mMonitor, SIGNAL( available( int ) ),
63
 
             this, SLOT( setStartTime( int ) ) );
64
 
    connect( &mMonitor, SIGNAL( statusChanged( int ) ),
65
 
             this, SLOT( resetData( int ) ) );
66
60
    connect( &mIcon, SIGNAL( statisticsSelected() ),
67
61
             this, SLOT( showStatisticsDialog() ) );
68
62
}
69
63
 
70
64
Interface::~Interface()
71
65
{
72
 
    if ( mStatusDialog != 0 )
73
 
    {
74
 
        delete mStatusDialog;
75
 
    }
76
 
    if ( mPlotterDialog != 0 )
77
 
    {
78
 
        delete mPlotterDialog;
79
 
    }
80
 
    if ( mPlotterTimer != 0 )
81
 
    {
82
 
        mPlotterTimer->stop();
83
 
        delete mPlotterTimer;
84
 
    }
 
66
    delete mStatusDialog;
 
67
    delete mPlotterDialog;
85
68
    if ( mStatistics != 0 )
86
69
    {
87
70
        // this will also delete a possibly open statistics dialog
91
74
 
92
75
void Interface::configChanged()
93
76
{
94
 
    // UNKNOWN_STATE to avoid notification
95
 
    mIcon.updateTrayStatus( UNKNOWN_STATE );
96
 
    // handle changed iconset by user
97
 
    mIcon.updateStatus( mState );
98
 
    mIcon.updateMenu();
99
 
 
100
 
    if ( mPlotterDialog != 0L )
101
 
    {
102
 
        mPlotterDialog->configChanged();
103
 
    }
 
77
    KSharedConfigPtr config = KGlobal::config();
 
78
    QString group( confg_interface );
 
79
    group += mName;
 
80
    KConfigGroup interfaceGroup( config, group );
 
81
    InterfaceSettings s;
 
82
    mSettings.alias = interfaceGroup.readEntry( conf_alias ).trimmed();
 
83
    mSettings.iconTheme = interfaceGroup.readEntry( conf_iconTheme, s.iconTheme );
 
84
    QStringList themeNames;
 
85
    QList<KNemoTheme> themes = findThemes();
 
86
    // Let's check that it's available
 
87
    foreach( KNemoTheme theme, themes )
 
88
        themeNames << theme.internalName;
 
89
    if ( !themeNames.contains( mSettings.iconTheme ) )
 
90
        mSettings.iconTheme = TEXT_THEME;
 
91
    mSettings.colorIncoming = interfaceGroup.readEntry( conf_colorIncoming, s.colorIncoming );
 
92
    mSettings.colorOutgoing = interfaceGroup.readEntry( conf_colorOutgoing, s.colorOutgoing );
 
93
    KColorScheme scheme(QPalette::Active, KColorScheme::View);
 
94
    mSettings.colorDisabled = interfaceGroup.readEntry( conf_colorDisabled, scheme.foreground( KColorScheme::InactiveText ).color() );
 
95
    mSettings.colorUnavailable = interfaceGroup.readEntry( conf_colorUnavailable, scheme.foreground( KColorScheme::InactiveText ).color() );
 
96
    mSettings.customCommands = interfaceGroup.readEntry( conf_customCommands, s.customCommands );
 
97
    mSettings.hideWhenDisconnected = interfaceGroup.readEntry( conf_hideWhenNotAvail, s.hideWhenDisconnected );
 
98
    mSettings.hideWhenUnavailable = interfaceGroup.readEntry( conf_hideWhenNotExist, s.hideWhenUnavailable );
 
99
    mSettings.activateStatistics = interfaceGroup.readEntry( conf_activateStatistics, s.activateStatistics );
 
100
    mSettings.trafficThreshold = clamp<unsigned int>(interfaceGroup.readEntry( conf_trafficThreshold, s.trafficThreshold ), 0, 1000 );
 
101
    mSettings.warnThreshold = clamp<double>(interfaceGroup.readEntry( conf_billingWarnThresh, s.warnThreshold ), 0.0, 9999.0 );
 
102
    mSettings.warnTotalTraffic = interfaceGroup.readEntry( conf_billingWarnRxTx, s.warnTotalTraffic );
 
103
 
 
104
    // TODO: Some of the calendars are a bit buggy, so default to Gregorian for now
 
105
    //mSettings.calendar = interfaceGroup.readEntry( conf_calendar, KGlobal::locale()->calendarType() );
 
106
    mSettings.calendar = interfaceGroup.readEntry( conf_calendar, "gregorian" );
 
107
 
 
108
    mSettings.customBilling = interfaceGroup.readEntry( conf_customBilling, s.customBilling );
 
109
 
 
110
    KCalendarSystem* calendar = KCalendarSystem::create( mSettings.calendar );
 
111
    QDate startDate = QDate::currentDate().addDays( 1 - calendar->day( QDate::currentDate() ) );
 
112
    mSettings.billingStart = interfaceGroup.readEntry( conf_billingStart, startDate );
 
113
    // No future start period
 
114
    if ( mSettings.billingStart > QDate::currentDate() )
 
115
        mSettings.billingStart = startDate;
 
116
    mSettings.billingMonths = clamp<int>(interfaceGroup.readEntry( conf_billingMonths, s.billingMonths ), 1, 6 );
 
117
    if ( mSettings.customBilling == false )
 
118
    {
 
119
        mSettings.billingMonths = 1;
 
120
        mSettings.billingStart = mSettings.billingStart.addDays( 1 - calendar->day( mSettings.billingStart ) );
 
121
    }
 
122
    mSettings.commands.clear();
 
123
    if ( mSettings.customCommands )
 
124
    {
 
125
        int numCommands = interfaceGroup.readEntry( conf_numCommands, s.numCommands );
 
126
        for ( int i = 0; i < numCommands; i++ )
 
127
        {
 
128
            QString entry;
 
129
            InterfaceCommand cmd;
 
130
            entry = QString( "%1%2" ).arg( conf_runAsRoot ).arg( i + 1 );
 
131
            cmd.runAsRoot = interfaceGroup.readEntry( entry, false );
 
132
            entry = QString( "%1%2" ).arg( conf_command ).arg( i + 1 );
 
133
            cmd.command = interfaceGroup.readEntry( entry );
 
134
            entry = QString( "%1%2" ).arg( conf_menuText ).arg( i + 1 );
 
135
            cmd.menuText = interfaceGroup.readEntry( entry );
 
136
            mSettings.commands.append( cmd );
 
137
        }
 
138
    }
 
139
 
 
140
    // This prevents needless regeneration of icon when first shown in tray
 
141
    if ( mState == KNemoIface::UnknownState )
 
142
    {
 
143
        mState = mBackendData->status;
 
144
        mPreviousState = mState;
 
145
    }
 
146
    mIcon.configChanged();
104
147
 
105
148
    if ( mStatistics != 0 )
106
149
    {
117
160
        // user turned off statistics
118
161
        stopStatistics();
119
162
    }
120
 
 
 
163
}
 
164
 
 
165
void Interface::processUpdate()
 
166
{
 
167
    mPreviousState = mState;
 
168
    unsigned int trafficThreshold = mSettings.trafficThreshold;
 
169
    mState = mBackendData->status;
 
170
 
 
171
    mRxRate = mBackendData->incomingBytes / mGeneralData.pollInterval;
 
172
    mTxRate = mBackendData->outgoingBytes / mGeneralData.pollInterval;
 
173
 
 
174
    QString title = mSettings.alias;
 
175
    if ( title.isEmpty() )
 
176
        title = mName;
 
177
 
 
178
    if ( mState & KNemoIface::Connected )
 
179
    {
 
180
        // the interface is connected, look for traffic
 
181
        if ( ( mBackendData->rxPackets - mBackendData->prevRxPackets ) > trafficThreshold )
 
182
            mState |= KNemoIface::RxTraffic;
 
183
        if ( ( mBackendData->txPackets - mBackendData->prevTxPackets ) > trafficThreshold )
 
184
            mState |= KNemoIface::TxTraffic;
 
185
 
 
186
        if ( mStatistics )
 
187
        {
 
188
            mStatistics->addIncomingData( mBackendData->incomingBytes );
 
189
            mStatistics->addOutgoingData( mBackendData->outgoingBytes );
 
190
        }
 
191
 
 
192
        updateTime();
 
193
 
 
194
        if ( mPreviousState < KNemoIface::Connected )
 
195
        {
 
196
            QString connectedStr;
 
197
            if ( mBackendData->isWireless )
 
198
                connectedStr = i18n( "%1 is connected to %2", title, mBackendData->essid );
 
199
            else
 
200
                connectedStr = i18n( "%1 is connected", title );
 
201
            if ( mPreviousState != KNemoIface::UnknownState )
 
202
                KNotification::event( "connected", connectedStr );
 
203
        }
 
204
    }
 
205
    else if ( mState & KNemoIface::Available )
 
206
    {
 
207
        if ( mPreviousState & KNemoIface::Connected )
 
208
        {
 
209
            KNotification::event( "disconnected", i18n( "%1 has disconnected", title ) );
 
210
            if ( mType == KNemoIface::PPP )
 
211
                backend->clearTraffic( mName );
 
212
            resetUptime();
 
213
        }
 
214
        else if ( mPreviousState < KNemoIface::Available )
 
215
        {
 
216
            if ( mPreviousState != KNemoIface::UnknownState )
 
217
                KNotification::event( "available", i18n( "%1 is available", title ) );
 
218
        }
 
219
    }
 
220
    else if ( mState == KNemoIface::Unavailable &&
 
221
              mPreviousState > KNemoIface::Unavailable )
 
222
    {
 
223
        KNotification::event( "unavailable", i18n( "%1 is unavailable", title ) );
 
224
        if ( mType == KNemoIface::PPP )
 
225
            backend->clearTraffic( mName );
 
226
        resetUptime();
 
227
    }
 
228
 
 
229
    if ( mPreviousState != mState )
 
230
        mIcon.updateTrayStatus();
 
231
 
 
232
    if ( mPlotterDialog )
 
233
        mPlotterDialog->updatePlotter( mRxRate / 1024.0, mTxRate / 1024.0 );
 
234
 
 
235
    mIcon.updateToolTip();
121
236
    if ( mStatusDialog )
122
 
    {
123
 
        mStatusDialog->setStatisticsGroupEnabled( mSettings.activateStatistics );
124
 
    }
125
 
}
126
 
 
127
 
void Interface::activateMonitor()
128
 
{
129
 
    mMonitor.checkStatus( this );
130
 
}
131
 
 
132
 
void Interface::setStartTime( int )
 
237
        mStatusDialog->updateDialog();
 
238
}
 
239
 
 
240
void Interface::resetUptime()
133
241
{
134
242
    mUptime = 0;
 
243
    mRealSec = 0.0;
135
244
    mUptimeString = "00:00:00";
136
 
    if ( !mPlotterTimer->isActive() )
137
 
        mPlotterTimer->start( 1000 );
 
245
    mRxRate = 0;
 
246
    mTxRate = 0;
138
247
}
139
248
 
140
 
void Interface::showStatusDialog()
 
249
void Interface::showStatusDialog( bool fromContextMenu )
141
250
{
142
251
    // Toggle the status dialog.
143
252
    // First click will show the status dialog, second will hide it.
144
253
    if ( mStatusDialog == 0L )
145
254
    {
146
255
        mStatusDialog = new InterfaceStatusDialog( this );
147
 
        connect( &mMonitor, SIGNAL( available( int ) ),
148
 
                 mStatusDialog, SLOT( enableNetworkGroups( int ) ) );
149
 
        connect( &mMonitor, SIGNAL( notAvailable( int ) ),
150
 
                 mStatusDialog, SLOT( disableNetworkGroups( int ) ) );
151
 
        connect( &mMonitor, SIGNAL( notExisting( int ) ),
152
 
                 mStatusDialog, SLOT( disableNetworkGroups( int ) ) );
153
256
        if ( mStatistics != 0 )
154
257
        {
155
258
            connect( mStatistics, SIGNAL( currentEntryChanged() ),
156
259
                     mStatusDialog, SLOT( statisticsChanged() ) );
157
260
            mStatusDialog->statisticsChanged();
158
261
        }
159
 
        activateOrHide( mStatusDialog, true );
160
 
    }
161
 
    else
162
 
    {
163
 
        // Toggle the status dialog.
164
 
        activateOrHide( mStatusDialog );
165
 
    }
 
262
    }
 
263
 
 
264
    activateOrHide( mStatusDialog, fromContextMenu );
166
265
}
167
266
 
168
 
void Interface::showSignalPlotter( bool wasMiddleButton )
 
267
void Interface::showSignalPlotter( bool fromContextMenu )
169
268
{
170
 
    if ( wasMiddleButton )
171
 
    {
172
 
        // Toggle the signal plotter.
173
 
        activateOrHide( mPlotterDialog );
174
 
    }
175
 
    else
176
 
    {
177
 
        // Called from the context menu, show the dialog.
178
 
        activateOrHide( mPlotterDialog, true );
179
 
    }
180
 
    if ( mPlotterDialog->isVisible() && !mPlotterTimer->isActive() )
181
 
        mPlotterTimer->start( 1000 );
 
269
    // Toggle the signal plotter.
 
270
    activateOrHide( mPlotterDialog, fromContextMenu );
182
271
}
183
272
 
184
273
void Interface::showStatisticsDialog()
193
282
        }
194
283
        connect( mStatistics, SIGNAL( dayStatisticsChanged() ),
195
284
                 mStatisticsDialog, SLOT( updateDays() ) );
196
 
        connect( mStatistics, SIGNAL( monthStatisticsChanged() ),
197
 
                 mStatisticsDialog, SLOT( updateMonths() ) );
 
285
        connect( mStatistics, SIGNAL( weekStatisticsChanged() ),
 
286
                 mStatisticsDialog, SLOT( updateWeeks() ) );
 
287
        connect( mStatistics, SIGNAL( monthStatisticsChanged( bool ) ),
 
288
                 mStatisticsDialog, SLOT( updateMonths( bool ) ) );
198
289
        connect( mStatistics, SIGNAL( yearStatisticsChanged() ),
199
290
                 mStatisticsDialog, SLOT( updateYears() ) );
200
291
        connect( mStatistics, SIGNAL( currentEntryChanged() ),
201
292
                 mStatisticsDialog, SLOT( updateCurrentEntry() ) );
202
 
        connect( mStatisticsDialog, SIGNAL( clearDailyStatisticsClicked() ),
203
 
                 mStatistics, SLOT( clearDayStatistics() ) );
204
 
        connect( mStatisticsDialog, SIGNAL( clearMonthlyStatisticsClicked() ),
205
 
                 mStatistics, SLOT( clearMonthStatistics() ) );
206
 
        connect( mStatisticsDialog, SIGNAL( clearYearlyStatisticsClicked() ),
207
 
                 mStatistics, SLOT( clearYearStatistics() ) );
 
293
        connect( mStatisticsDialog, SIGNAL( clearStatistics() ),
 
294
                 mStatistics, SLOT( clearStatistics() ) );
208
295
 
209
296
        /* We need to show the dialog before we update the stats.  That way
210
297
         * the viewport doesn't get messed up when we scroll to the most recent
212
299
        mStatisticsDialog->show();
213
300
 
214
301
        mStatisticsDialog->updateDays();
215
 
        mStatisticsDialog->updateMonths();
 
302
        mStatisticsDialog->updateWeeks();
 
303
        mStatisticsDialog->updateMonths( false );
216
304
        mStatisticsDialog->updateYears();
217
305
    }
218
306
    else
219
307
        mStatisticsDialog->show();
220
308
}
221
309
 
222
 
void Interface::resetData( int state )
223
 
{
224
 
    // For PPP interfaces we will reset all data to zero when the
225
 
    // interface gets disconnected. If the driver also resets its data
226
 
    // (like PPP seems to do) we will start from zero for every new
227
 
    // connection.
228
 
    if ( mType == PPP &&
229
 
         ( state == NOT_AVAILABLE ||
230
 
           state == NOT_EXISTING ) )
231
 
    {
232
 
        mData.prevTxBytes = mData.txBytes = 0;
233
 
        mData.prevRxBytes = mData.rxBytes = 0;
234
 
        mData.prevTxPackets = mData.txPackets = 0;
235
 
        mData.prevRxPackets = mData.rxPackets = 0;
236
 
    }
237
 
}
238
 
 
239
 
void Interface::updateDetails()
240
 
{
241
 
    InterfaceData &data = getData();
242
 
 
243
 
    mUptime += mGeneralData.pollInterval;
244
 
    QString uptime;
245
 
    if ( data.available )
246
 
    {
247
 
        time_t upsecs = mUptime;
248
 
        time_t updays = upsecs / 86400;
249
 
 
250
 
        if ( updays == 1 )
251
 
            uptime = "1 day, ";
252
 
        else if ( updays > 1 )
253
 
            uptime = QString( "%1 days, " ).arg( updays );
254
 
 
255
 
        upsecs -= 86400 * updays; // we only want the seconds of today
256
 
        int hrs = upsecs / 3600;
257
 
        int mins = ( upsecs - hrs * 3600 ) / 60;
258
 
        int secs = upsecs - hrs * 3600 - mins * 60;
259
 
        QString time;
260
 
        time.sprintf( "%02d:%02d:%02d", hrs, mins, secs );
261
 
        uptime += time;
262
 
    }
263
 
    mUptimeString = uptime;
264
 
 
265
 
    mIcon.updateToolTip();
266
 
    if ( mStatusDialog )
267
 
        mStatusDialog->updateDialog();
268
 
}
269
 
 
270
 
void Interface::updatePlotter()
271
 
{
272
 
    if ( mPlotterDialog )
273
 
    {
274
 
        double outgoingBytes = mData.outgoingBytes / 1024.0 / (double) mGeneralData.pollInterval;
275
 
        double incomingBytes = mData.incomingBytes / 1024.0 / (double) mGeneralData.pollInterval;
276
 
        mPlotterDialog->updatePlotter( incomingBytes, outgoingBytes );
277
 
    }
 
310
void Interface::updateTime()
 
311
{
 
312
    mRealSec += mGeneralData.pollInterval;
 
313
    if ( mRealSec < 1.0 )
 
314
        return;
 
315
 
 
316
    mUptime += trunc( mRealSec );
 
317
    mRealSec -= trunc( mRealSec );
 
318
 
 
319
    time_t updays = mUptime / 86400;
 
320
 
 
321
    mUptimeString = i18np("1 day, ","%1 days, ",updays);
 
322
 
 
323
    mUptime -= 86400 * updays; // we only want the seconds of today
 
324
    int hrs = mUptime / 3600;
 
325
    int mins = ( mUptime - hrs * 3600 ) / 60;
 
326
    int secs = mUptime - hrs * 3600 - mins * 60;
 
327
    QString time;
 
328
    time.sprintf( "%02d:%02d:%02d", hrs, mins, secs );
 
329
    mUptimeString += time;
278
330
}
279
331
 
280
332
void Interface::startStatistics()
281
333
{
282
334
    mStatistics = new InterfaceStatistics( this );
283
 
    connect( &mMonitor, SIGNAL( incomingData( unsigned long ) ),
284
 
             mStatistics, SLOT( addIncomingData( unsigned long ) ) );
285
 
    connect( &mMonitor, SIGNAL( outgoingData( unsigned long ) ),
286
 
             mStatistics, SLOT( addOutgoingData( unsigned long ) ) );
 
335
    connect( mStatistics, SIGNAL( warnMonthlyTraffic( quint64 ) ),
 
336
             this, SLOT( warnMonthlyTraffic( quint64 ) ) );
287
337
    if ( mStatusDialog != 0 )
288
338
    {
289
339
        connect( mStatistics, SIGNAL( currentEntryChanged() ),
290
340
                 mStatusDialog, SLOT( statisticsChanged() ) );
291
341
        mStatusDialog->statisticsChanged();
292
342
    }
293
 
 
294
 
    mStatistics->loadStatistics();
295
343
}
296
344
 
297
345
void Interface::stopStatistics()
298
346
{
299
 
    if ( mStatisticsDialog != 0 )
300
 
    {
301
 
        // this will close an open statistics dialog
302
 
        delete mStatisticsDialog;
303
 
        mStatisticsDialog = 0;
304
 
    }
 
347
    // this will close an open statistics dialog
 
348
    delete mStatisticsDialog;
 
349
    mStatisticsDialog = 0;
305
350
 
306
351
    mStatistics->saveStatistics();
307
352
 
309
354
    mStatistics = 0;
310
355
}
311
356
 
 
357
void Interface::warnMonthlyTraffic( quint64 traffic )
 
358
{
 
359
    QString title = mSettings.alias;
 
360
    if ( title.isEmpty() )
 
361
        title = mName;
 
362
 
 
363
    KNotification::event( "exceededMonthlyTraffic",
 
364
                          i18n( "%1: Monthly traffic limit exceeded (currently %2)", title, KIO::convertSize( traffic ) )
 
365
                        );
 
366
}
 
367
 
312
368
// taken from ksystemtray.cpp
313
369
void Interface::activateOrHide( QWidget* widget, bool onlyActivate )
314
370
{