//------------------------------------------------------------------------------
// Name: QGmailNotifier
// Desc:
//------------------------------------------------------------------------------
QGmailNotifier::QGmailNotifier(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f), trayIcon_(0), alertIndex_(-1), animationIndex_(0) {

	ui.setupUi(this);

	gmailFeed_ = new GMailFeed(this);
	connect(gmailFeed_, SIGNAL(fetchComplete(QNetworkReply *)), this, SLOT(fetchComplete(QNetworkReply *)));

	trayIcon_ = new QSystemTrayIcon(this);
	trayIcon_->setContextMenu(createMenu());
	trayIcon_->setIcon(QIcon(":/img/normal.svgz"));

	connect(trayIcon_, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(activated(QSystemTrayIcon::ActivationReason)));
	connect(trayIcon_, SIGNAL(messageClicked()), this, SLOT(messageClicked()));

	trayIcon_->show();

	// start the check timer
	timer_ = new QTimer(this);
	connect(timer_, SIGNAL(timeout()), this, SLOT(doCheck()));
	timer_->start(0);

	// setup the anim timer
	animationTimer_ = new QTimer(this);
	connect(animationTimer_, SIGNAL(timeout()), this, SLOT(doAnim()));
}
예제 #2
0
파일: LogoWidget.cpp 프로젝트: KDE/kwave
//***************************************************************************
Kwave::LogoWidget::LogoWidget(QWidget *parent)
    :QWidget(parent), m_width(-1), m_height(-1), m_repaint(false),
     m_image(0), m_logo(xpm_aboutlogo), m_timer(0),
     m_color_h(0.0)
{
    for (int i = 0; i < MAXSIN; m_deg[i++] = 0) {}

    m_timer = new QTimer(this);
    Q_ASSERT(m_timer);
    if (!m_timer) return;
    connect(m_timer, SIGNAL(timeout()), this, SLOT(doAnim()));

    // gives 40ms refresh ;-)...
    m_timer->setInterval(40);
    m_timer->start();

    QPalette pal = palette();
    pal.setColor(QPalette::Window, Qt::black);
    setPalette(pal);
}