Beispiel #1
0
LegacySystemTray::LegacySystemTray(QWidget *parent)
  : SystemTray(parent),
  _blinkState(false),
  _lastMessageId(0)
{
#ifndef HAVE_KDE
  _trayIcon = new QSystemTrayIcon(associatedWidget());
#else
  _trayIcon = new KSystemTrayIcon(associatedWidget());
  // We don't want to trigger a minimize if a highlight is pending, so we brutally remove the internal connection for that
  disconnect(_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
                 _trayIcon, SLOT(activateOrHide(QSystemTrayIcon::ActivationReason)));
#endif
#ifndef Q_WS_MAC
  connect(_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
                     SLOT(on_activated(QSystemTrayIcon::ActivationReason)));
#endif
  connect(_trayIcon, SIGNAL(messageClicked()),
                     SLOT(on_messageClicked()));

  _blinkTimer.setInterval(500);
  _blinkTimer.setSingleShot(false);
  connect(&_blinkTimer, SIGNAL(timeout()), SLOT(on_blinkTimeout()));

  connect(this, SIGNAL(toolTipChanged(QString,QString)), SLOT(syncLegacyIcon()));
}
Beispiel #2
0
void Interface::showStatusDialog( bool fromContextMenu )
{
    // Toggle the status dialog.
    // First click will show the status dialog, second will hide it.
    if ( mStatusDialog == 0L )
    {
        mStatusDialog = new InterfaceStatusDialog( this );
        if ( mIfaceStatistics != 0 )
        {
            connect( mIfaceStatistics, SIGNAL( currentEntryChanged() ),
                     mStatusDialog, SLOT( statisticsChanged() ) );
            mStatusDialog->statisticsChanged();
        }
    }

    activateOrHide( mStatusDialog, fromContextMenu );
}
Beispiel #3
0
void KSystemTray::toggleActive()
{
    activateOrHide();
}
Beispiel #4
0
void Interface::showSignalPlotter( bool fromContextMenu )
{
    // Toggle the signal plotter.
    activateOrHide( mPlotterDialog, fromContextMenu );
}