Commit 22168b25 authored by scuq's avatar scuq

blinking tray test build

parent 2a09f1b2
Pipeline #375 failed with stage
in 18 seconds
......@@ -11,9 +11,13 @@ AicTrayIcon::AicTrayIcon(QWidget *parent)
void AicTrayIcon::setupIcon()
{
menu = new QMenu(this->myParent);
iconMovie = new QMovie((":/images/aic.png"));
iconMovie = new QMovie((":/images/aic.gif"));
iconMovie->setSpeed(50);
iconMovie->start();
actionOpen = new QAction(tr("&Open"), this);
connect(actionOpen, SIGNAL(triggered()), this->myParent, SLOT(slShow()));
......@@ -42,5 +46,13 @@ void AicTrayIcon::updateIcon()
void AicTrayIcon::slBeFlashy()
{
iconMovie-
qDebug() << "FFFFFFFFFFFFFFFFFFFFFFLLLLLLLLLLLLLLA";
connect(iconMovie, SIGNAL(frameChanged(int)), this, SLOT(updateIcon()));
}
void AicTrayIcon::slBeUnFlashy()
{
qDebug() << "UUUUUUUUUUUUFFFFFFFFFFFLLLLLLLLLLLLLLA";
this->iconMovie->jumpToFrame(0);
disconnect(iconMovie, SIGNAL(frameChanged(int)), this, SLOT(updateIcon()));
}
......@@ -6,6 +6,7 @@
#include <QAction>
#include <QSystemTrayIcon>
#include <QMovie>
#include <QDebug>
class AicTrayIcon : public QSystemTrayIcon
{
......@@ -14,7 +15,7 @@ public:
AicTrayIcon(QWidget *parent);
private:
void setupIcon();
void updateIcon();
QMenu *menu;
QAction *actionOpen;
QAction *actionClose;
......@@ -24,6 +25,7 @@ private:
private slots:
void slBeFlashy();
void slBeUnFlashy();
void updateIcon();
};
......
......@@ -12,6 +12,8 @@ qmMainWindow::qmMainWindow(QWidget *parent) :
m_mp = new manipulator();
m_mp->setInitialized(true);
this->setupTrayIcon();
this->updateQuestionShown = false;
uc = new updateCheck(this);
......@@ -38,7 +40,7 @@ qmMainWindow::qmMainWindow(QWidget *parent) :
this->printDebugSslLib();
this->setupTrayIcon();
......@@ -200,6 +202,7 @@ void qmMainWindow::setupTableViews()
connect( this->m_mp, SIGNAL(siGlobalSettingsChanged(QMap<QString, QVariant>)), rostermodel, SLOT(slGlobalSettingsChanged(QMap<QString, QVariant>)) );
connect( this->m_mp, SIGNAL(siRosterSettingsChanged(QMap<QString, QVariant>)), rostermodel, SLOT(slRosterSettingsChanged(QMap<QString, QVariant>)) );
connect(rostermodel, SIGNAL(siUnreadsPending()), this, SLOT(slUnreadsPending()));
connect(rostermodel, SIGNAL(siUnreadsPending()), this->trayIcon, SLOT(slBeFlashy()));
this->m_mp->apply();
......@@ -289,6 +292,13 @@ void qmMainWindow::closeEvent(QCloseEvent *closeev)
}
}
void qmMainWindow::changeEvent(QEvent *ev)
{
if(ev->type() == QEvent::ActivationChange && this->isActiveWindow()) {
emit ( RisenFromTray() );
}
}
void qmMainWindow::restoreWindowPositionState()
{
restoreGeometry(this->m_mp->getLoadWindowPosition("main"));
......@@ -301,6 +311,8 @@ void qmMainWindow::createTrayIcon()
trayIcon = new AicTrayIcon(this);
connect(trayIcon,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason)));
connect(this,SIGNAL(RisenFromTray()),trayIcon,SLOT(slBeUnFlashy()));
//RisenFromTray
}
......@@ -515,6 +527,7 @@ void qmMainWindow::slExit()
void qmMainWindow::slShow()
{
this->show();
emit ( RisenFromTray() );
this->setWindowState(Qt::WindowNoState);
}
......@@ -528,6 +541,7 @@ void qmMainWindow::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
if(reason == QSystemTrayIcon::DoubleClick) {
this->show();
this->raise();
emit ( RisenFromTray() ) ;
this->activateWindow();
if( this->isMinimized() )
this->showNormal();
......
......@@ -46,6 +46,7 @@ private:
void loadTheme(QString theme);
void setupTableViews();
void closeEvent(QCloseEvent *closeev);
void changeEvent(QEvent *ev);
void restoreWindowPositionState();
void createTrayIcon();
bool getCloseToTray() const;
......@@ -75,7 +76,8 @@ private:
void setupTrayIcon();
signals:
void RisenFromTray();
private slots:
......
......@@ -3,6 +3,7 @@
<file>images/aic.png</file>
<file>themes/dark.qss</file>
<file>images/aic_alt.png</file>
<file>images/aic.gif</file>
</qresource>
<qresource prefix="/themes"/>
</RCC>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment