* Fix #604 and #605

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* clear current prio on color command

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* Fix QTimer threading issues

* Call QTimer start() stop() from QEvent

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* send initial color/image to WebUI
hide error message when opening webbrowser

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* added streaming timer to update WebUI Preview

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* remove QMetaObject::invokeMethod()

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* added parent to streaming timers

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* header cleanup
This commit is contained in:
Paulchen Panther
2019-08-24 22:53:30 +02:00
committed by brindosch
parent c419f305f3
commit 24495bbc65
8 changed files with 150 additions and 74 deletions

View File

@@ -1,5 +1,6 @@
#include <list>
#include <unistd.h>
#include <QPixmap>
#include <QWindow>
@@ -128,7 +129,31 @@ void SysTray::closeEvent(QCloseEvent *event)
void SysTray::settings()
{
// Hide error messages when opening webbrowser
int out_pipe[2];
int saved_stdout;
int saved_stderr;
// saving stdout and stderr file descriptor
saved_stdout = ::dup( STDOUT_FILENO );
saved_stderr = ::dup( STDERR_FILENO );
if(::pipe(out_pipe) == 0)
{
// redirecting stdout to pipe
::dup2(out_pipe[1], STDOUT_FILENO);
::close(out_pipe[1]);
// redirecting stderr to stdout
::dup2(STDOUT_FILENO, STDERR_FILENO);
}
QDesktopServices::openUrl(QUrl("http://localhost:"+QString::number(_webPort)+"/", QUrl::TolerantMode));
// restoring stdout
::dup2(saved_stdout, STDOUT_FILENO);
// restoring stderr
::dup2(saved_stderr, STDERR_FILENO);
}
void SysTray::setEffect()