Ejemplo n.º 1
0
//! [0]
Window::Window()
{
    createIconGroupBox();
    createMessageGroupBox();

    iconLabel->setMinimumWidth(durationLabel->sizeHint().width());

    createActions();
    createTrayIcon();

    connect(showMessageButton, SIGNAL(clicked()), this, SLOT(showMessage()));
    connect(showIconCheckBox, SIGNAL(toggled(bool)), trayIcon, SLOT(setVisible(bool)));
    connect(iconComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setIcon(int)));
    connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(iconGroupBox);
    mainLayout->addWidget(messageGroupBox);
    setLayout(mainLayout);

    iconComboBox->setCurrentIndex(1);
    trayIcon->show();

    setWindowTitle(tr("Systray"));
    resize(400, 300);
}
Ejemplo n.º 2
0
Buddies::Buddies(QWidget *parent)
    : QMainWindow(parent)
{
	ui.setupUi(this);
	getSysInfo();
	createIconGroupBox();
	createActions();
	createTrayIcon();
	countOnlineUsers();




    QTimer * counter = new QTimer( this );
    connect( counter, SIGNAL(timeout()),
	             this, SLOT(structUser()) );
	counter->start( 3000 );
	qDebug("=> Starting timer 1sec interval...");






	//connect(ui.sendBtn, SIGNAL(clicked()), this, SLOT(showMessage()));
	// connect(ui.showIconCheckBox, SIGNAL(toggled(bool)), trayIcon, SLOT(setVisible(bool)));
    connect(ui.iconComboBox, SIGNAL(currentIndexChanged(int)),this, SLOT(setIcon(int)));
	connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
	connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
	           this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

	ui.iconComboBox->setCurrentIndex(1);

	trayIcon->show();

	setWindowTitle(tr("Buddies"));
	//resize(400, 300);


	ui.listWidget->setIconSize(QSize(40, 40));

	//showMessage();

//-- timer 5 min for online Users Baloon

	QTimer * onlinetimer = new QTimer( this );
		    connect( onlinetimer, SIGNAL(timeout()),
			             this, SLOT(onlineNotify()) );
			onlinetimer->start( 300000 );
			qDebug("=> Starting timer 5min interval...");

//-- Information on Edit Tab

			Information();
//-- Database status
			dbstatus();

}
Ejemplo n.º 3
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    //Background image
    QPixmap pix("C:/Kobus/werk/RedUI/images/worldmap_notdone.png");
    //QPixmap scaled = pix.scaled(QSize(1000, 1000));
    ui->backround_image->setPixmap(pix);    //TODO scaling with app

    //System tray
    createIconGroupBox();
    createMessageGroupBox();
    createActions();
    createTrayIcon();
    trayIcon->show();
    showMessage();
}
Ejemplo n.º 4
0
//! \param[in] parent Qobject parent or nothing
//! \brief Constructor
//! \brief Create action, tray icon, signal, popup.
TrayIcon::TrayIcon(QWidget * parent)
  : QWidget(parent) {
  createIconGroupBox();
  createMessageGroupBox();
  createActions();
  createTrayIcon();

  connect(iconComboBox, SIGNAL(currentIndexChanged(int)),
          this, SLOT(setIcon(int)));
  connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
  connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
          this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

  this->setIcon(TrayIcon::Normal);

  // a appeler pour changer l'icone
  iconComboBox->setCurrentIndex(TrayIcon::Normal);
  trayIcon->show();

  _popup = new Popup(220, 150);
}